home *** CD-ROM | disk | FTP | other *** search
/ Power CD / Power CD ATARI-Rechner Lieben.iso / APPS / PD / EMACS / EMACS.DOC < prev    next >
Encoding:
Text File  |  1989-03-03  |  112.5 KB  |  4,222 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.         MicroEMACS
  18.  
  19.         Full Screen Text Editor
  20.         Reference Manual (preliminary draft)
  21.  
  22.         Version 3.8i
  23.         April 27, 1987
  24.  
  25.         (C)opyright 1987 by Daniel M. Lawrence
  26.         Reference Manual (C)opyright 1987
  27.             by Brian Straight and Daniel M. Lawrence
  28.         All Rights Reserved
  29.  
  30.         MicroEMACS 3.8i can be copied and distributed freely
  31.         for any non-commercial purposes. MicroEMACS 3.8i can
  32.         only be incorporated into commercial software with
  33.         the permission of the current author.
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71. Introduction
  72.  
  73.     MicroEMACS  is    a  tool  for  creating    and  changing documents,
  74. programs, and other  text  files.    It  is both relatively easy for the
  75. novice    to  use,  but  also  very  powerful  in the hands of an  expert.
  76. MicroEMACS can be extensively customized for the needs of the individual
  77. user.
  78.  
  79.     MicroEMACS allows several files to be edited at  the  same time.
  80. The  screen  can  be split into different windows, and text may be moved
  81. freely from one window to the next.  Depending on the type of file being
  82. edited, MicroEMACS can change  how  it    behaves  to make editing simple.
  83. Editing standard text files, program files and word processing documents
  84. are all possible at the same time.
  85.  
  86.     There are extensive capabilities  to  make  word  processing and
  87. editing  easier.    These  include  commands  for  string searching  and
  88. replacing, paragraph reformatting and deleting, automatic word wrapping,
  89. word move and deletes, easy case controlling, and automatic word counts.
  90.  
  91.     For complex and  repetitive  editing tasks editing macros can be
  92. written.  These macros allow the  user    a great degree of flexibility in
  93. determining how MicroEMACS behaves.    Also any and all the commands can
  94. be used by  any  keystroke  by    changing,  or  rebinding,  what commands
  95. various keys are connected, or bound, to.
  96.  
  97.     Special features are also available  to perform a diverse set of
  98. operations such as file encryption,  automatic    backup    file generation,
  99. entabbing and detabbing  lines,  executing of DOS commands and filtering
  100. of text through other programs (like SORT to allow sorting text).
  101.  
  102. History
  103.  
  104.     EMACS was originally  a  text editor written by Richard Stahlman
  105. at  MIT  in  the  early  1970s for Digital Equipment computers.  Various
  106. versions, rewrites and clones have made an appearance since.
  107.  
  108.     This version of MicroEMACS is  derived from code written by Dave
  109. G.  Conroy in 1985.  Later modifications were performed by Steve Wilhite
  110. and George Jones.  In December of 1985    Daniel    Lawrence  picked  up the
  111. then current source  (version  2.0) and has made extensive modifications
  112. and additions to  it over the course of the next two years.  Updates and
  113. support for  the  current  version  is    still  in progress.  The current
  114. program author can be contacted by writing to:
  115.  
  116.     USMAIL: Daniel Lawrence
  117.         617 New York St
  118.         Lafayette, IN 47901
  119.  
  120.     UUCP:    ihnp4!pur-ee!pur-phy!duncan!lawrence
  121.     ARPA:    nwd@j.cc.purdue.edu
  122.     FIDO:    Fido 201/2 The Programmer's Room (317) 742-5533
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135. MicroEMACS Reference Manual                  Basic Concepts
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.                    Chapter 1
  145.  
  146.                  Basic Concepts
  147.  
  148.  
  149.     The current version of MicroEMACS is 3.8i (Third major re-write,
  150. eighth public release, Ith  (or  ninth) minor release), and for the rest
  151. of this document, we shall simply refer to this version as "EMACS".  Any
  152. modifications for later versions will be listed in the appendixes at the
  153. end of this manual.
  154.  
  155.  
  156. 1.1  Keys and the Keyboard
  157.  
  158.  
  159.     Many  times  throughout  this manual we will  be  talking  about
  160. commands  and  the keys on the keyboard needed use them.   There  are  a
  161. number of "special" keys which can be used and are listed here:
  162.  
  163. <NL>         NewLine which    is also called RETURN or ENTER, this key
  164.          is used to end different commands.
  165.  
  166. ^         The control  key  can    be  used  before  any alphabetic
  167.          character and some  symbols.    For example, ^C means to
  168.          hold down the <CONTROL>  key  and type the C key at the
  169.          same time.
  170.  
  171. ^X         The  CONTROL-X key is used at    the  beginning    of  many
  172.          different commands.
  173.  
  174. META or M-     This is a special EMACS key used to begin many commands
  175.          as well.  This key is pressed, and then released before
  176.          typing the next character.    On  most systems, this is
  177.          the  <ESC>  key,  but    it  can  be  changed.    (consult
  178.          appendix D to learn  what  key is used for META on your
  179.          computer).
  180.  
  181.     Whenever a command is described, the manual will list the actual
  182. keystrokes needed to execute it in boldface using the above conventions,
  183. and also the name of the command in italics.
  184.  
  185.  
  186. 1.2  Getting Started
  187.  
  188.  
  189.     In order to use EMACS, you must call it up from your system's or
  190. computer's command prompt.    On  UNIX    and  MSDOS  machines,  just type
  191. "emacs" from the main command prompt and follow it with the  <RETURN> or
  192.  
  193.  
  194.                                        1
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201. Basic Concepts                     MicroEMACS Reference Manual
  202.  
  203.  
  204. <ENTER> key (we will refer to  this  key  as <NL> for "new-line" for the
  205. remainder  of  this  manual).  On the Macintosh, the Amiga, the ATARI ST
  206. and other icon based operating systems, double click on the uEMACS icon.
  207. Shortly after this, a screen similar to the one below should appear.
  208.  
  209.  
  210. 1.3  Parts and Pieces
  211.  
  212.  
  213.     The screen is divided into a number of    areas  or  windows.   On
  214. some systems the top window contains a function list  of  unshifted  and
  215. shifted function keys.    We will discuss these keys later. Below  them is
  216. an EMACS  mode    line  which,  as we will see, informs you of the present
  217. mode of operation of  the  editor--for example "(WRAP)" if you set EMACS
  218. to wrap at the end  of each line. Under the mode line is the text window
  219. where  text  appears  and is manipulated.  Since each window has its own
  220. mode line, below the text window is it's mode line.   The  last  line of
  221. the screen is the command line where EMACS takes commands and reports on
  222. what it is doing.
  223.  
  224. ===============================================================================
  225. f1 search      f2 search back : F1 toggle function list F2 toggle help file
  226. f3 hunt        f4 hunt back   : F3 find command/apropos F4 describe key
  227. f5 next window f6 exec macro  : F5 reformat paragraph    F6 ref undented region
  228. f7 find file   f8 exec file   : F7 indent region    F8 undent region
  229. f9 save file  f10 exit emacs  : F9 execute DOS command F10 shell up
  230. ===============================================================================
  231. -- MicroEMACS 3.8i () -- Function Keys ---------------------------------------
  232. ===============================================================================
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245. ===============================================================================
  246. -- MicroEMACS 3.8i () -- Main ------------------------------------------------
  247. ===============================================================================
  248.         Fig 1:    EMACS screen on an IBM-PC
  249.  
  250.  
  251. 1.4  Entering Text
  252.  
  253.  
  254.     Entering text in EMACS is simple.  Type  the  following sentence
  255. fragment:
  256.  
  257.      Fang Rock lighthouse, center of a series of mysterious and
  258.  
  259.  
  260. 2
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267. MicroEMACS Reference Manual                  Basic Concepts
  268.  
  269.  
  270. The text is displayed at the top of the text window.  Now type:
  271.  
  272.      terrifying events at the turn of the century
  273.  
  274.     Notice the text to the left  of  the cursor disappears and a '$'
  275. sign appears.  Don't panic--your  text is safe!!! You've just discovered
  276. that  EMACS  doesn't  "wrap"  text  to    the  next  line  like most  word
  277. processors unless you hit <NL>.  But since EMACS is  used  for both word
  278. processing, and text editing, it has a bit of a  dual  personality.  You
  279. can change the way it works by setting various modes.  In this case, you
  280. need  to set WRAP mode, using the add-mode command, by typing ^X-M.  The
  281. command line at  the base of the screen will prompt you for the mode you
  282. wish  to  add.     Type wrap followed by the <NL> key and any text you now
  283. enter will be wrapped.      However, the command doesn't wrap text already
  284. entered.  To get rid of  the  truncated line, delete characters with the
  285. <BACKSPACE>  key  until the '$' goes away.  Now type in  the  words  you
  286. deleted, watch how EMACS goes down to the next line  at  the right time.
  287. (In some  versions  of    EMACS,    WRAP is a default mode in which case you
  288. don't  have  to  worry    about  the instructions relating to adding  this
  289. mode.)
  290.  
  291.     Now let's type a longer insert.  Hit <NL> a  couple  of times to
  292. tab  down  from  the  text  you  just  entered.  Now type the  following
  293. paragraphs.  Press <NL> twice to indicate a paragraph break.
  294.  
  295.      Fang Rock lighthouse, center of  a  series  of  mysterious and
  296.      terrifying events at the turn of the century, is  built  on  a
  297.      rocky  island  a  few miles of the Channel coast.    So small is
  298.      the island that wherever you stand its rocks are wet  with sea
  299.      spray.
  300.  
  301.      The lighthouse tower is in the center of the island.   A steep
  302.      flight of steps leads to the heavy door in its base.   Winding
  303.      stairs lead up to the crew room.
  304.  
  305.  
  306. 1.5  Basic cursor movement
  307.  
  308.  
  309.     Now  let's practice moving around in this text.    To  move  the
  310. cursor back to    the  word  "Winding,"  enter  M-B  previous-word.   This
  311. command moves the cursor backwards by one word at a time.  Note you have
  312. to press the key combination every time the  cursor  steps  back  by one
  313. word.     Continuously  pressing  META  and toggling B produces an  error
  314. message.    To    move forward to the word "stairs" enter M-F, which moves
  315. the cursor forward by one word at a time.
  316.  
  317.     Notice that EMACS commands are usually mnemonic--F  for forward,
  318. B for backward, for example.
  319.  
  320.     To move the cursor up one line, enter ^P previous-line, down one
  321. line ^N next-line.  Practice this  movement  by moving the cursor to the
  322. word "terrifying" in the second line.
  323.  
  324.  
  325.  
  326.                                        3
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333. Basic Concepts                     MicroEMACS Reference Manual
  334.  
  335.  
  336.     The  cursor may also be moved forward  or  backward  in  smaller
  337. increments.    To  move forward by  one  character,  enter  ^F    forward-
  338. character, to move  backward,  ^B backward-character.  EMACS also allows
  339. you  to  specify a number which is normally used to tell  a  command  to
  340. execute  many  times.    To repeat most commands, press META and then the
  341. number before you enter the  command.     Thus,    the  command  META  5 ^F
  342. (M-5^F) will move  the    cursor    forward  by five characters.  Try moving
  343. around in the text by using these commands.  For extra practice, see how
  344. close  you can come to the word "small" in the first paragraph by giving
  345. an argument to the commands listed here.
  346.  
  347.     Two other simple cursor commands that are useful to help us move
  348. around in the text are M-N next-paragraph which moves the cursor  to the
  349. second paragraph, and M-P previous-paragraph  which moves it back to the
  350. previous paragraph.  The cursor may  also  be moved rapidly from one end
  351. of  the line to the other.  Move the cursor to the  word  "few"  in  the
  352. second line.  Press ^A beginning-of-line.  Notice the  cursor  moves  to
  353. the word "events" at the beginning of the line.  Pressing ^E end-of-line
  354. moves the cursor to the end of the line.
  355.  
  356.     Finally, the cursor may be moved  from    any point in the file to
  357. the  end  or  beginning of the file.  Entering M-> end-of-file moves the
  358. cursor    to the end of the buffer, M-<  beginning-of-file  to  the  first
  359. character of the file.
  360.  
  361.     On the IBM-PC, the ATARI ST and many other machines,  the cursor
  362. keys can also  be  used to move the cursor about.  Also, if there is one
  363. available, moving the mouse will move the cursor.
  364.  
  365.     Practice moving the cursor in the text until you are comfortable
  366. with the commands we've explored in this chapter.
  367.  
  368.  
  369. 1.6  Saving your text
  370.  
  371.  
  372.     When you've finished practicing cursor movement, save your file.
  373. Your file currently  resides  in  a  BUFFER.   The buffer is a temporary
  374. storage area for your text, and is lost when the computer is turned off.
  375. You can save the buffer to a file by entering  ^X-^S  save-file.  Notice
  376. that  EMACS informs you that your file has no name and will not let  you
  377. save it.
  378.  
  379.     To  save  your    buffer to a file with a different name than it's
  380. current one (which is empty), press ^X^W write-file.  EMACS  will prompt
  381. you for  the  filename    you  wish to write.  Enter the name fang.txt and
  382. press return.    On a micro, the drive light will come on, and EMACS will
  383. inform you it is writing the file.  When it finishes, it will inform you
  384. of the number of lines it has written to the disk.
  385.  
  386.     Congratulations!! You've just saved your first EMACS file!
  387.  
  388.  
  389.  
  390.  
  391.  
  392. 4
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399. MicroEMACS Reference Manual                  Basic Concepts
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.                Chapter 1 Summary
  407.  
  408.  
  409.     In chapter 1, you learned how to enter    text,  how  to    use wrap
  410. mode, how to move the  cursor, and to save a buffer.  The following is a
  411. table  of  the    commands covered in this chapter and their corresponding
  412. key bindings:
  413.  
  414. Key Binding        Keystroke    Effect
  415.  
  416. abort-command        ^G        aborts current command
  417.  
  418. add-mode        ^XM        allows addition of EMACS
  419.                     mode such as WRAP
  420.  
  421. backward-character    ^B        moves cursor left one character
  422.  
  423. beginning-of-file    M-<        moves cursor to beginning of file
  424.  
  425. beginning-of-line    ^A        moves cursor to beginning of line
  426.  
  427. end-of-file        M->        moves cursor to end of file
  428.  
  429. end-of-line        ^E        moves cursor to end of line
  430.  
  431. forward-character    ^F        moves cursor right one character
  432.  
  433. next-line        ^N        moves cursor to next line
  434.  
  435. next-paragraph        M-N        moves cursor to next paragraph
  436.  
  437. next-word        M-F        moves cursor forward one word
  438.  
  439. previous-line        ^P        moves cursor backward by one line
  440.  
  441. previous-paragraph    M-P        moves cursor to previous paragraph
  442.  
  443. previous-word        M-B        moves cursor backward by one word
  444.  
  445. save-file        ^X-^S        saves current buffer to a file
  446.  
  447. write-file        ^X-^W        save current buffer under a new name
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.                                        5
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465. Basic Editing--Simple Insertions and Deletions        MicroEMACS Reference
  466.                                   Manual
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.                    Chapter 2
  476.  
  477.          Basic Editing--Simple Insertions and Deletions
  478.  
  479.  
  480. 2.1  A Word About Windows, Buffers, Screens, and Modes
  481.  
  482.  
  483.     In the first chapter, you learned how to create and save  a file
  484. in EMACS. Let's do some more editing on  this  file.    Call up emacs by
  485. typing in the following command.
  486.  
  487.     emacs fang.txt
  488.  
  489.     On  icon  oriented  systems, double click on  the  uEMACS  icon,
  490. usually a file dialog box of some sort    will  appear.     Choose FANG.TXT
  491. from the appropriate folder.
  492.  
  493.     Shortly  after    you  invoke EMACS, the text should appear on the
  494. screen ready  for  you    to  edit.  The text you are looking at currently
  495. resides in a buffer.  A  buffer  is  a temporary area of computer memory
  496. which is the primary unit internal to EMACS -- this  is  the place where
  497. EMACS goes to work.  The mode line at the bottom of the screen lists the
  498. buffer name, FANG.TXT and the name of the file with which this buffer is
  499. associated, FANG.TXT
  500.  
  501.     The computer talks to you through  the    use of its screen.  This
  502. screen usually has an area of 24 lines    each  of  80  characters across.
  503. You can use  EMACS  to    subdivide  the screen into several separate work
  504. areas, or windows, each  of  which can be 'looking into' different files
  505. or sections of text.  Using windows, you  can  work  on  several related
  506. texts at one  time,  copying  and  moving blocks of text between windows
  507. with ease.   To  keep  track  of  what    you  are editing, each window is
  508. identified by a mode line on the last line of the window which lists the
  509. name of  the  buffer  which  it is looking into, the file from which the
  510. text was read, and how the text is being edited.
  511.  
  512.     An EMACS mode tells EMACS how  to  deal  with user input.  As we
  513. have already seen, the mode 'WRAP' controls how EMACS  deals  with  long
  514. lines (lines with over 79 characters) while the user is typing    them in.
  515. The  'VIEW' mode, allows you to read a file without modifying it.  Modes
  516. are associated with buffers and not  with  files; hence, a mode needs to
  517. be explicitly set or removed every time you  edit  a  file.   A new file
  518. read into a buffer with a previously specified mode will be edited under
  519. this  mode.    If you use specific modes frequently, EMACS allows you to
  520. set the modes which are used by all new buffers, called global modes.
  521.  
  522.  
  523.  
  524. 6
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531. MicroEMACS Reference Manual        Basic Editing--Simple Insertions and
  532.                                    Deletions
  533.  
  534.  
  535. 2.2  Insertions
  536.  
  537.  
  538.     Your previously-saved text should look like this:
  539.  
  540.      Fang Rock lighthouse, center of  a  series  of  mysterious and
  541.      terrifying events at the turn of the century, is  built  on  a
  542.      rocky  island  a  few miles of the Channel coast.    So small is
  543.      the island that wherever you stand its rocks are wet  with sea
  544.      spray.
  545.  
  546.      The lighthouse tower is in the center of the island.   A steep
  547.      flight of steps leads to the heavy door in its base.   Winding
  548.      stairs lead up to the crew room.
  549.  
  550.     Let's assume you want to add a sentence in the    second paragraph
  551. after  the  word  "base."    Move the cursor until it is on the  "W"  of
  552. "Winding". Now type the following:
  553.  
  554.      This gives entry  to  the    lower  floor  where  the  big steam
  555.      generator    throbs    steadily  away,  providing  power  for    the
  556.      electric lantern.
  557.  
  558.     If the line fails to  wrap and you end up with a '$' sign in the
  559. right margin, just  enter  M-Q fill-paragraph to reformat the paragraph.
  560. This  new  command  attempts to fill out a paragraph.    Long  lines  are
  561. divided up, and  words    are  shuffled  around to make the paragraph look
  562. nicer.
  563.  
  564.     Notice that all visible EMACS characters  are  self-inserting --
  565. all you  had  to  do  was type the characters to insert and the existing
  566. text made space for it.  With a few exceptions discussed later, all non-
  567. printing characters  (such as control or escape sequences) are commands.
  568. To insert spaces,  simply use the space bar.  Now move to the first line
  569. of the file and type ^O open-line (Oh, not zero).    You've just learned
  570. how to insert a blank line in your text.
  571.  
  572.  
  573. 2.3  Deletions
  574.  
  575.  
  576.     EMACS  offers  a  number of deletion options.  For example, move
  577. the cursor until it's under the period at the end  of  the insertion you
  578. just  did.    Press  the  backspace  key.   Notice the "n" on  "lantern"
  579. disappeared.  The backspace implemented on EMACS is called a destructive
  580. backspace--it  removes    text   immediately  before  the  current  cursor
  581. position  from    the  buffer.    Now  type  ^H delete-previous-character.
  582. Notice    that  the  cursor  moves  back and obliterates    the  "r"--either
  583. command will backspace the cursor.
  584.  
  585.     Type in the two letters you erased to restore your text and move
  586. the cursor to the  beginning  of the buffer M-> beginning-of-file.  Move
  587. the cursor down one line to the beginning of the first paragraph.
  588.  
  589.  
  590.                                        7
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597. Basic Editing--Simple Insertions and Deletions        MicroEMACS Reference
  598.                                   Manual
  599.  
  600.  
  601.     To delete the  forward character, type ^D delete-next-character.
  602. The  "F" of "Fang" disappears.    Continue to type ^D until the whole word
  603. is erased EMACS also permits the deletion of larger  elements  of  text.
  604. Move  the  cursor  to the word "center"  in  the  first  line  of  text.
  605. Pressing  M-<backspace> delete-previous-word kills the word  immediately
  606. before the cursor.  M-^H has the same effect.
  607.  
  608.     Notice    that  the  commands  are  very    similar  to the  control
  609. commands  you  used  to delete individual letters.  As a general rule in
  610. EMACS,    control sequences affect small areas  of  text,  META  sequences
  611. larger areas.  The word forward of the cursor position can  therefore be
  612. deleted  by  typing  M-D  delete-next-word.    Now  let's take    out  the
  613. remainder of the first    line  by typing ^K kill-to-end-of-line.  You now
  614. have a blank  line  at the top of your screen.    Typing ^K again or ^X-^O
  615. delete-blank-lines deletes the blank line and flushes the second line to
  616. the top of the text.  Now exit EMACS by typing ^X-^C exit-emacs.  Notice
  617. EMACS  reminds    you  that you have not saved your buffer.    Ignore  the
  618. warning and exit.  This way you can exit EMACS without saving any of the
  619. changes you just made.
  620.  
  621.  
  622.  
  623.  
  624.                Chapter 2 Summary
  625.  
  626.  
  627.     In Chapter 2, you learned about the basic  'building  blocks' of
  628. an EMACS text file--buffers, windows, and files.
  629.  
  630. Key binding        Keystroke    Effect
  631. delete-previous-character
  632.             ^H        deletes character immediately before
  633.                     the current cursor position
  634.  
  635. delete-next-character    ^D        deletes character immediately after
  636.                     current cursor position
  637.  
  638. delete-previous-word    M-^H        deletes word immediately before
  639.                     current cursor position
  640.  
  641. delete-next-word    M-D        deletes word immediately after
  642.                     current cursor position
  643.  
  644. kill-to-end-of-line    ^K        deletes from current cursor
  645.                     position to end of line
  646.  
  647. insert-space        ^C        inserts a space to right of cursor
  648.  
  649. open-line        ^O        inserts blank line
  650.  
  651. delete-blank-lines    ^X-^O        removes blank line
  652.  
  653. exit-emacs        ^X-^C        exits emacs
  654.  
  655.  
  656. 8
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663. MicroEMACS Reference Manual                   Using Regions
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.                    Chapter 3
  673.  
  674.                  Using Regions
  675.  
  676.  
  677. 3.1  Defining and Deleting a Region
  678.  
  679.  
  680.     At  this  point  its time to familiarize ourselves with two more
  681. EMACS  terms--the point and the mark.  The  point  is  located    directly
  682. behind the current cursor position.  The mark (as we shall  see shortly)
  683. is user defined.    These  two    elements together are called the current
  684. region    and limit the region of text on which EMACS performs many of its
  685. editing functions.
  686.  
  687.     Let's begin by entering some new text.    Don't forget to add wrap
  688. mode if its not set  on this buffer.  Start EMACS and open a file called
  689. PUBLISH.TXT.  Type in the following text:
  690.  
  691.      One  of  the  largest growth areas in  personal  computing  is
  692.      electronic publishing.    There  are  packages  available    for
  693.      practically  every machine from elegantly simple programs    for
  694.      the humble Commodore 64 to sophisticated professional packages
  695.      for PC and Macintosh computers.
  696.  
  697.      Electronic publishing is as  revolutionary  in  its way as the
  698.      Gutenburg press.    Whereas the printing press allowed the mass
  699.      production and distribution of  the  written  word, electronic
  700.      publishing puts the means of production in the hands of nearly
  701.      every individual.    From  the  class  magazine to the corporate
  702.      report, electronic publishing is changing the  way  we produce
  703.      and disseminate information.
  704.  
  705.      Personal  publishing   greatly   increases   the    utility  of
  706.      practically every computer.  Thousands  of  people  who joined
  707.      the  computer revolution of this decade  only  to    hide  their
  708.      machines unused in closets have  discovered a new use for them
  709.      as dedicated publishing workstations.
  710.  
  711.     Now let's do some editing.  The last paragraph    seems  a  little
  712. out of place.  To see what the document looks like without it we can cut
  713. it from the text by moving the cursor to the beginning of the paragraph.
  714. Enter M-<space> set-mark.  EMACS will respond with "[Mark  set]".    Now
  715. move the cursor to the end of the paragraph.  You  have  just  defined a
  716. region    of  text.  To remove this text from the screen,  type  ^W  kill-
  717. region.  The paragraph disappears from the screen.
  718.  
  719.  
  720.  
  721.  
  722.                                        9
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729. Using Regions                     MicroEMACS Reference Manual
  730.  
  731.  
  732.     On further consideration, however, perhaps the paragraph  we cut
  733. wasn't so bad after all.   The    problem  may have been one of placement.
  734. If we could  tack  it on to the end of the first paragraph it might work
  735. quite well to support and strengthen  the  argument.  Move the cursor to
  736. the end of  the first paragraph and enter ^Y yank.  Your text should now
  737. look like this:
  738.  
  739.      One  of  the  largest growth areas in  personal  computing  is
  740.      electronic publishing.    There  are  packages  available    for
  741.      practically  every machine from elegantly simple programs    for
  742.      the humble Commodore 64 to sophisticated professional packages
  743.      for PC and Macintosh computers.   Personal  publishing greatly
  744.      increases    the   utility    of   practically   every  computer.
  745.      Thousands of people who joined the computer revolution of this
  746.      decade  only to hide their machines  unused  in  closets  have
  747.      discovered  a  new  use  for  them  as   dedicated  publishing
  748.      workstations.
  749.  
  750.      Electronic publishing is as  revolutionary  in  its way as the
  751.      Gutenburg press.    Whereas the printing press allowed the mass
  752.      production and distribution of  the  written  word, electronic
  753.      publishing puts the means of production in the hands of nearly
  754.      every individual. From the  class    magazine  to  the corporate
  755.      report, electronic publishing is changing the  way  we produce
  756.      and disseminate information.
  757.  
  758.  
  759. 3.2  Yanking a Region
  760.  
  761.  
  762.     The text you cut initially  didn't simply just disappear, it was
  763. cut  into  a  buffer that retains the 'killed' text appropriately called
  764. the kill  buffer.    ^Y  "yanks" the text back from this buffer into the
  765. current buffer. If you have a long line (indicated, remember, by the "$"
  766. sign), simply hit M-Q to reformat the paragraph.
  767.  
  768.     There are other uses to which the kill buffer can be put.  Using
  769. the method we've already learned, define the last paragraph as a region.
  770. Now type M-W copy-region.  Nothing seems to have  happened;  the  cursor
  771. stays blinking at the point.   But  things have changed, even though you
  772. may not be able to see any alteration.
  773.  
  774.     To see what  has  happened  to    the contents of the kill buffer,
  775. move the cursor down a couple  of  lines  and "yank" the contents of the
  776. kill  buffer  back  with ^Y.  Notice the last paragraph is now repeated.
  777. The region you defined is "tacked on" to the end of your file because M-
  778. W  copies a region to the kill buffer while leaving the original text in
  779. your working buffer.    Some  caution  is  needed  however,  because the
  780. contents of the  kill  buffer  are  updated when you delete any regions,
  781. lines  or  words.   If you are moving large quantities of text, complete
  782. the  operation    before    you do any more deletions or you could find that
  783. the text you want to move has been replaced by the most recent deletion.
  784. Remember--a buffer is a  temporary  area of computer memory that is lost
  785. when the machine is powered down or switched off.  In order to make your
  786.  
  787.  
  788. 10
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795. MicroEMACS Reference Manual                   Using Regions
  796.  
  797.  
  798. changes permanent, they must be saved to a file before you  leave EMACS.
  799. Let's  delete  the section of text we just added and save  the    file  to
  800. disk.
  801.  
  802.  
  803.  
  804.  
  805.                Chapter 3 Summary
  806.  
  807.  
  808.     In Chapter 3, you learned how to achieve  longer  insertions and
  809. deletions.   The  EMACS  terms    point  and  mark were introduced and you
  810. learned how to manipulate text with the kill buffer.
  811.  
  812. Key Binding    Keystroke    Effect
  813.  
  814. Delete-Region    ^W        Deletes region between point and mark and
  815.                 places it in KILL buffer
  816.  
  817. Copy-Region    M-W        Copies text between point and mark into
  818.                 KILL buffer
  819.  
  820. Yank-Text    ^Y        Inserts a copy of the KILL buffer into
  821.                 current buffer at point
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.                                       11
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861. Search and Replace                 MicroEMACS Reference Manual
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.                    Chapter 4
  871.  
  872.                Search and Replace
  873.  
  874.  
  875. 4.1  Forward Search
  876.  
  877.  
  878.     Load EMACS and    bring  in  the    file  you just saved.  Your file
  879. should look like the one below.
  880.  
  881.      One  of  the  largest growth areas in  personal  computing  is
  882.      electronic publishing.    There  are  packages  available    for
  883.      practically  every machine from elegantly simple programs    for
  884.      the humble Commodore 64 to sophisticated professional packages
  885.      for PC and Macintosh computers.   Personal  publishing greatly
  886.      increases    the   utility    of   practically   every  computer.
  887.      Thousands of people who joined the computer revolution of this
  888.      decade  only to hide their machines  unused  in  closets  have
  889.      discovered  a  new  use  for  them  as   dedicated  publishing
  890.      workstations.
  891.  
  892.      Electronic publishing is as  revolutionary  in  its way as the
  893.      Gutenburg press.    Whereas the printing press allowed the mass
  894.      production and distribution of  the  written  word, electronic
  895.      publishing puts the means of production in the hands of nearly
  896.      every individual. From the  class    magazine  to  the corporate
  897.      report, electronic publishing is changing the  way  we produce
  898.      and disseminate information.
  899.  
  900.     Let's  use  EMACS  to search for the word "revolutionary" in the
  901. second    paragraph.    Because  EMACS  searches from the  current  cursor
  902. position toward the  end  of  buffers,    and we intend to search forward,
  903. move the cursor to the beginning of the text.  Enter  ^S search-forward.
  904. Note that the command line now reads
  905.  
  906.     "Search [] <META>:"
  907.  
  908.     EMACS is prompting you to enter the search string  --  the  text
  909. you want to find.  Enter  the  word  revolutionary and hit the META key.
  910. The cursor moves to the end of the word "revolutionary."
  911.  
  912.     Notice that you must  enter  the <META> key to start the search.
  913. If  you  simply  press    <NL>  the  command  line responds  with  "<NL>".
  914. Although this may seem infuriating to users who are used to pressing the
  915. return    key  to  execute  any  command,  EMACS'  use  of <META> to begin
  916. searches allows it to pinpoint text with great accuracy.    After  every
  917. line wrap or carriage return, EMACS 'sees' a new line  character (<NL>).
  918.  
  919.  
  920. 12
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927. MicroEMACS Reference Manual                  Search and Replace
  928.  
  929.  
  930. If you need to search for a word at the end of a line,    you  can specify
  931. this word uniquely in EMACS.
  932.  
  933.     In our sample text  for  example, the word "and" occurs a number
  934. of times, but only once at the end  of    a  line.    To    search    for this
  935. particular occurrence of the  word,  move the cursor to the beginning of
  936. the buffer and type ^S.  Notice that  EMACS  stores  the  last specified
  937. search string as the default string.  If  you  press  <META>  now, EMACS
  938. will search for the default string, in this case, "revolutionary."
  939.  
  940.     To change this string  so  we can search for our specified "and"
  941. simply enter the word and followed by <NL>.  The command line now shows:
  942.  
  943.     "search [and<NL>]<META>:"
  944.  
  945.     Press <META> and the cursor moves to "and"  at    the  end  of the
  946. second last line.
  947.  
  948.  
  949. 4.2  Exact Searches
  950.  
  951.  
  952.     If  the  mode  EXACT is active    in  the  current  buffer,  EMACS
  953. searches on a case sensitive basis.  Thus, for example you  could search
  954. for Publishing as distinct from publishing.
  955.  
  956.  
  957. 4.3  Backward Search
  958.  
  959.  
  960.     Backward searching is very similar to  forward    searching except
  961. that it is implemented in the reverse direction.  To implement a reverse
  962. search,  type ^R search-reverse.  Because  EMACS  makes  no  distinction
  963. between forward and backward stored search strings, the last search item
  964. you entered appears as the default  string.   Try searching back for any
  965. word that  lies  between  the  cursor  and  the beginning of the buffer.
  966. Notice    that when the item is found, the point moves to the beginning of
  967. the found string (i.e., the cursor appears under the first letter of the
  968. search item).
  969.  
  970.     Practice searching for other words in your text.
  971.  
  972.  
  973. 4.4  Searching and Replacing
  974.  
  975.  
  976.     Searching  and    replacing  is a powerful and quick way of making
  977. changes to your text.     Our sample text is about electronic publishing,
  978. but the correct  term  is  'desktop'  publishing.  To make the necessary
  979. changes we need to replace all occurrences of the word "electronic" with
  980. "desktop." First, move the cursor to the top of the current  buffer with
  981. the  M-<  command.  Then type M-R  replace-string.    The  command  line
  982. responds:
  983.  
  984.  
  985.  
  986.                                       13
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993. Search and Replace                 MicroEMACS Reference Manual
  994.  
  995.  
  996.     "Replace []<META>:"
  997.  
  998.     where the square brackets enclose  the default string.    Type the
  999. word electronic and hit <META>.  The command line responds:
  1000.  
  1001.     "with []<META>"
  1002.  
  1003.     type  desktop<META>.    EMACS  replaces  all  instances  of  the
  1004. original  word    with  your  revision.     Of  course,  you  will have  to
  1005. capitalize  the  first    letter    of  "desktop"  where  it occurs  at  the
  1006. beginning of a sentence.
  1007.  
  1008.     You  have  just  completed an unconditional replace.    In  this
  1009. operation,  EMACS  replaces  every instance of the found string with the
  1010. replacement string.
  1011.  
  1012.  
  1013. 4.5  Query-Replace
  1014.  
  1015.  
  1016.     You may  also  replace    text  on a case by case basis.    The M-^R
  1017. query-replace-string command causes  EMACS  to pause at each instance of
  1018. the found string.
  1019.  
  1020.     For example, assume we    want  to  replace  some instances of the
  1021. word "desktop" with the word "personal." Go back to the beginning of the
  1022. current buffer and enter the  M-^R query-replace command.  The procedure
  1023. is  very  similar  to  that  which  you  followed in  the  unconditional
  1024. search/replace option.    When the  search begins however, you will notice
  1025. that EMACS pauses at each instance of "publishing" and asks  whether you
  1026. wish to replace it with the  replacement  string.   You have a number of
  1027. options available for response:
  1028.  
  1029.     Response    Effect
  1030.     Y(es)    Make the current replacement and skip to the next
  1031.         occurrence of the search string
  1032.  
  1033.     N(o)    Do not make this replacement but continue
  1034.  
  1035.     !    Do the rest of the replacements with no more queries
  1036.  
  1037.     U(ndo)    Undo just the last replacement and query for it
  1038.         again (This can only go back ONE time)
  1039.  
  1040.     ^G    Abort the replacement command (This action does not
  1041.         undo previously-authorized replacements
  1042.  
  1043.     .    Same effect as ^G, but cursor returns to the point at
  1044.         which the replacement command was given
  1045.  
  1046.     ?    This lists help for the query replacement command
  1047.  
  1048.     Practice searching and searching and  replacing  until    you feel
  1049. comfortable with the commands and their effects.
  1050.  
  1051.  
  1052. 14
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059. Windows                                      MicroEMACS Reference Manual
  1060.  
  1061.  
  1062.                Chapter 4 Summary
  1063.  
  1064.  
  1065.     In this chapter, you learned how to search for specified strings
  1066. of  text  in  EMACS.    The  chapter  also dealt with searching for  and
  1067. replacing elements within a buffer.
  1068.  
  1069. Key Binding        Keystroke             Effect
  1070.  
  1071. Search-Forward        ^S    Searches from point to end of buffer.
  1072.                 Point is moved from current location to
  1073.                 the end of the found string
  1074.  
  1075. Search-Backward         ^R    Searches from point to beginning of buffer.
  1076.                 Point is moved from current location to
  1077.                 beginning of found string
  1078.  
  1079. Replace                 M-R Replace ALL occurrences of search string with
  1080.                 specified (null) string from point to the
  1081.                 end of the current buffer
  1082.  
  1083. Query-Replace           M-^R    As above, but pause at each found string
  1084.                 and query for action
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118. 16
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125. MicroEMACS Reference Manual                     Windows
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.                    Chapter 5
  1135.  
  1136.                 Windows
  1137.  
  1138.  
  1139. 5.1  Creating Windows
  1140.  
  1141.  
  1142.     We  have already met windows in an earlier  chapter.    In  this
  1143. chapter, we will explore one of EMACS' more powerful  features    --  text
  1144. manipulation through multiple windowing.
  1145.  
  1146.     You will recall that  windows  are areas of buffer text that you
  1147. can see on the screen.    Because EMACS can support several screen windows
  1148. simultaneously you can    use  them  to  look into different places in the
  1149. same  buffer.     You  can  also  use them to look at text  in  different
  1150. buffers.  In effect, you can edit several files at the same time.
  1151.  
  1152.     Let's invoke EMACS and pull  back our file on desktop publishing
  1153. by typing
  1154.  
  1155.      emacs publish.txt
  1156.  
  1157.     When  the  text  appears,  type  the  ^X-2  split-current-window
  1158. command.  The  window  splits  into  two  windows.  The window where the
  1159. cursor resides is called the current  window  -- in this case the bottom
  1160. window.  Notice  that  each window has a text area and a mode line.  The
  1161. command line is however, common to all windows on the screen.
  1162.  
  1163.     The  two  windows  on your screen are virtually mirror images of
  1164. each  other because the new window is opened into the same buffer as the
  1165. one you are in when you issue the  Open-Window    command.    All commands
  1166. issued    to  EMACS are executed on the  current    buffer    in  the  current
  1167. window.
  1168.  
  1169.     To move  the  cursor  to  the  upper  window (i.e., to make that
  1170. window the current window, type ^X-P previous-window.  Notice the cursor
  1171. moves to the upper or previous window.    Entering ^X-O  next-window moves
  1172. to the next window.  Practice  moving  between windows.  You will notice
  1173. that you can  also  move  into    the  Function Key menu by entering these
  1174. commands.
  1175.  
  1176.     Now move to the upper window.  Let's open a new  file.      On the
  1177. EMACS  disk is a tutorial file.  Let's call it into the upper window  by
  1178. typing:
  1179.  
  1180.      ^X-^F find-file
  1181.  
  1182.  
  1183.  
  1184.                                       17
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191. Windows                                      MicroEMACS Reference Manual
  1192.  
  1193.  
  1194. and press return.  Then enter the filename emacs.tut.
  1195.  
  1196.     In a short time, the tutorial file will appear    in  the  window.
  1197. We now    have  two  windows  on    the  screen, each looking into different
  1198. buffers.  We  have just used the ^X- ^F find-file command to find a file
  1199. and bring it into our current window.
  1200.  
  1201.     You can scroll any window up  and  down with the cursor keys, or
  1202. with the commands  we've  learned  so  far. However, because the area of
  1203. visible  text in each window is relatively small,  you    can  scroll  the
  1204. current window a line at a time.
  1205.  
  1206.     Type ^X-^N move-window-down
  1207.  
  1208.     The current window scrolls down by  one  line -- the top line of
  1209. text scrolls out of view, and the bottom line moves  towards  the top of
  1210. the  screen.    You can imagine, if you like, the  whole  window  slowly
  1211. moving down to the end of the buffer  in  increments  of  one line.  The
  1212. command  ^X-^P    move-window-up    scrolls  the  window  in   the    opposite
  1213. direction.
  1214.  
  1215.     As  we have seen, EMACS editing commands  are  executed  in  the
  1216. current  window,  but  the  program  does support a useful feature  that
  1217. allows you to scroll  the  next window.  M-^Z scroll-next-up scrolls the
  1218. next window up, M-^U  scroll-next-down    scrolls  it  downward.    From the
  1219. tutorial  window,  practice  scrolling    the  window  with   the  desktop
  1220. publishing text in it up and down.
  1221.  
  1222.     When you're finished,  exit  EMACS without saving any changes in
  1223. your files.
  1224.  
  1225.     Windows offer you  a  powerful    and  easy  way to edit text.  By
  1226. manipulating   a  number  of  windows  and   buffers   on   the   screen
  1227. simultaneously,  you can perform complete edits  and  revisions  on  the
  1228. computer screen while having your  draft text or original data available
  1229. for reference in another window.
  1230.  
  1231.     Experiment  with splitting the windows on  your  screen.    Open
  1232. windows into different buffers and experiment with any    other  files you
  1233. may have.  Try editing the text in each window, but don't forget to save
  1234. any changes you want to keep --  you  still  have  to  save  each buffer
  1235. separately.
  1236.  
  1237.  
  1238. 5.2  Deleting Windows
  1239.  
  1240.  
  1241. 5.3  Resizing Windows
  1242.  
  1243.  
  1244. 5.4  Other Window commands
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250. 18
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257. MicroEMACS Reference Manual                     Windows
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.                Chapter 5 Summary
  1265.  
  1266.  
  1267.     In  Chapter  5    you  learned  how to manipulate windows and  the
  1268. editing flexibility they offer.
  1269.  
  1270. Key Binding        Keystroke               Effect
  1271.  
  1272. Open-Window        ^X-2        Splits current window into two windows
  1273.                     if space is available
  1274.  
  1275. Close-Windows        ^X-1        Closes all windows except current
  1276.                     window
  1277.  
  1278. Next-Window        ^X-O        Moves point into next (i.e. downward)
  1279.                     window
  1280.  
  1281. Previous-Window         ^X-P        Moves point to previous (i.e. upward)
  1282.                     window
  1283.  
  1284. Move-Window-Down    ^X-^N        Scrolls current window down one line
  1285.  
  1286. Move-Window-Up        ^X-^P        Scrolls current window up one line
  1287.  
  1288. Redraw-display        M-! or        Window is moved so line with point
  1289.             M-^L        (with cursor) is at center of window
  1290.  
  1291. Grow-Window        ^X-^        Current window is enlarged by one
  1292.                     line and nearest window is shrunk by
  1293.                     one line
  1294.  
  1295. Shrink-Window        ^X-^Z        Current window is shrunk by one line
  1296.                     and nearest window is enlarged by one
  1297.                     line
  1298.  
  1299. Clear-and-Redraw    ^L        Screen is blanked and redrawn.    Keeps
  1300.                     screen updates in sync with your
  1301.                     commands
  1302.  
  1303. Scroll-Next-Up        M-^Z        Scrolls next window up by one line
  1304.  
  1305. Scroll-Next-Down    M-^U        Scrolls next window down by one line
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.                                       19
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323. Buffers                                      MicroEMACS Reference Manual
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.                    Chapter 6
  1333.  
  1334.                 Buffers
  1335.  
  1336.  
  1337.      We have already learned a  number  of things about buffers.  As
  1338. you  will  recall,  they are the major internal entities in EMACS -- the
  1339. place  where  editing  commands are executed.  They are characterized by
  1340. their  names,  their  modes,  and  by  the  file  with    which  they  are
  1341. associated.   Each buffer also "remembers" its mark  and  point.    This
  1342. convenient feature allows you to go  to  other buffers and return to the
  1343. original location in the "current" buffer.
  1344.  
  1345.     Advanced users of EMACS frequently have a number  of  buffers in
  1346. the computer's memory simultaneously.  In the last chapter, for example,
  1347. you opened at least two buffers -- one into the  text  you were editing,
  1348. and the other into the EMACS on-line tutorial.    If you deal with complex
  1349. text files -- say, sectioned chapters  of  a  book, you may have five or
  1350. six buffers in    the  computer's  memory.    You  could    select different
  1351. buffers  by simply calling up the file with  ^X-^F  find-file,    and  let
  1352. EMACS  open  or  reopen  the  buffer.     However,  EMACS offers fast and
  1353. sophisticated buffering techniques that you will find easy to master and
  1354. much more convenient to use.
  1355.  
  1356.     Let's begin by opening three buffers.  You can    open  any  three
  1357. you choose, for example call  the following files into memory: fang.txt,
  1358. publish.txt, and emacs.tut  in    the  order  listed  here.    When you've
  1359. finished this process, you'll  be  looking at a screen showing the EMACS
  1360. tutorial.    Let's  assume that you want to move to the fang.txt buffer.
  1361. Enter:
  1362.  
  1363.     ^X-X next-buffer
  1364.  
  1365.     This command moves you to the next buffer.  Because EMACS cycles
  1366. through the buffer list, which is  alphabetized,  you will now be in the
  1367. fang.txt buffer. Using ^X-X again  places you in the publish.txt buffer.
  1368. If  you  are  on a machine that supports function keys, using ^X-X again
  1369. places you in the Function Keys buffer. Using ^X-X one last  time cycles
  1370. you back to the beginning of the list.
  1371.  
  1372.     If you have a large number of buffers to deal with, this cycling
  1373. process  may  be  slow and inconvenient.  The command ^X-B select-buffer
  1374. allows    you to specify the buffer you wish to be switched to.  When  the
  1375. command  is entered, EMACS prompts, "Use buffer:".    Simply  enter  the
  1376. buffer    name  (NOT  the file name), and that buffer will then become the
  1377. current buffer.
  1378.  
  1379.  
  1380.  
  1381.  
  1382. 20
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389. MicroEMACS Reference Manual                     Buffers
  1390.  
  1391.  
  1392.     Multiple buffer manipulation and editing is a  complex activity,
  1393. and you will probably  find  it very inconvenient to re-save each buffer
  1394. as you modify it.  The    command  ^X-^B list-buffers creates a new window
  1395. that  gives  details  about  all  the buffers currently known to  EMACS.
  1396. Buffers that have been modified are identified by  the    "buffer changed"
  1397. indicator (an asterisk in the second column).  You can thus  quickly and
  1398. easily identify buffers that need to  be  saved to files before you exit
  1399. EMACS.     The buffer window also provides  other  information  --  buffer
  1400. specific modes, buffer size, and buffer name are also listed.    To close
  1401. this window, simply type the close-windows command, ^X-1.
  1402.  
  1403.     To delete any buffer,  type  ^X-K  delete-buffer.  EMACS prompts
  1404. you "Kill buffer:".   Enter the buffer name you want to delete.  As this
  1405. is  destructive  command,  EMACS will ask for confirmation if the buffer
  1406. was  changed and not saved.  Answer Y(es) or N(o).  As usual ^G  cancels
  1407. the command.
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.                                       21
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455. Buffers                                      MicroEMACS Reference Manual
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.                Chapter 6 Summary
  1463.  
  1464.  
  1465.     In Chapter 6 you learned how to manipulate buffers.
  1466.  
  1467. Key Binding        Keystroke               Effect
  1468. Next-Buffer        ^X-^X        Switch to the next buffer in the
  1469.                     buffer list
  1470.  
  1471. Select-Buffer        ^X-B        Switch to a particular buffer
  1472.  
  1473. List-Buffers        ^X-^B        List all buffers
  1474.  
  1475. Delete-Buffer        ^X-K        delete a particular buffer if it
  1476.                     is off-screen
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514. 22
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521. MicroEMACS Reference Manual                       Modes
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.                    Chapter 7
  1531.  
  1532.                  Modes
  1533.  
  1534.  
  1535.     EMACS  allows  you  to change the  way    it  works  in  order  to
  1536. customized it to the style of editing you are using.   It  does  this by
  1537. providing a number of different modes.    These modes can effect    either a
  1538. single buffer, or any new  buffer that is created.  To add a mode to the
  1539. current buffer, type ^X-M add-mode.  EMACS will then prompt you  for the
  1540. name of a mode to add.    When you type  in  a legal mode name, and type a
  1541. <NL>, EMACS will  add the mode name to the list of current mode names in
  1542. the mode line of the current buffer.
  1543.  
  1544.     To remove an existing  mode,  typing  the ^X-^M delete-mode will
  1545. cause EMACS to prompt you  for    the  name  of  a mode to delete from the
  1546. current buffer.  This will remove  that  mode  from the mode list on the
  1547. current mode line.
  1548.  
  1549.     Global modes are  the  modes  which  are  inherited  by  any new
  1550. buffers which are created.  For example, if you wish to always do string
  1551. searching with character  case    being significant, you would want global
  1552. mode EXACT to be set so that any new files read  in  inherent  the EXACT
  1553. mode.  Global modes are set with the M-M  add-global-mode  command,  and
  1554. unset  with  the  M-^M delete-global-mode command.   Also,  the  current
  1555. global modes are  displayed  in  the  first line of a ^X-^B list-buffers
  1556. command.
  1557.  
  1558.     On machines which are capable  of  displaying  colors,    the mode
  1559. commands can also set  the  background    and foreground character colors.
  1560. Using add-mode or  delete-mode    with  a  lowercase  color  will  set the
  1561. background color in the current window.  An uppercase color will set the
  1562. foreground color in the  current  window.  Colors that EMACS knows about
  1563. are: white, cyan, magenta, yellow, blue, red, green, and black.   If the
  1564. computer you  are  running  on    does  not  have eight colors, EMACS will
  1565. attempt to make some intelligent guess at what color to use when you ask
  1566. for one which is not there.
  1567.  
  1568.  
  1569. 7.1  ASAVE mode
  1570.  
  1571.  
  1572.     Automatic Save mode  tells  EMACS to automatically write out the
  1573. current buffer to its associated file on a regular basis.  Normally this
  1574. will be  every    256  characters  typed    into  the file.  The environment
  1575. variable $ACOUNT counts down to the next auto-save, and  $ASAVE  is  the
  1576. value used to reset $ACOUNT after a save occurs.
  1577.  
  1578.  
  1579.  
  1580.                                       23
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587. Modes                         MicroEMACS Reference Manual
  1588.  
  1589.  
  1590. 7.2  CMODE mode
  1591.  
  1592.  
  1593.     CMODE is useful to  C  programmers.  When CMODE is active, EMACS
  1594. will try to assist the user in a number of  ways.    This  mode  is  set
  1595. automatically with files that have a .c or .h extension.
  1596.  
  1597.     The <NL> key  will  normally  attempt  to return the user to the
  1598. next line at the same level  of  indentation as the current line, unless
  1599. the  current line ends with a open brace ({) in which case the new  line
  1600. will be further indented by one tab position.
  1601.  
  1602.     A close brace (}) will    delete one tab position preceding itself
  1603. as  it is typed.  This should line up the close brace with its    matching
  1604. IF, FOR or WHILE statement.
  1605.  
  1606.     A  pound  sign    (#) with only leading whitespace will delete all
  1607. the whitespace preceding itself.  This    will  always  bring preprocessor
  1608. directives flush to the left margin.
  1609.  
  1610.     Whenever any close fence  is  typed,  i.e  )]>}, if the matching
  1611. open fence is on screen in  the  current window, the cursor will briefly
  1612. flash to it,  and  then  back.    This  makes  balancing    expressions, and
  1613. matching blocks much easier.
  1614.  
  1615.  
  1616. 7.3  CRYPT mode
  1617.  
  1618.  
  1619.     When a buffer is in CRYPT  mode,  it is encrypted whenever it is
  1620. written to a file, and decrypted when it  is  read  from  the file.  The
  1621. encryption key can be specified on the command line with the  -k switch,
  1622. or with the M-E set-encryption-key command.    If you attempt to read or
  1623. write a buffer in crypt mode and now key has not  been    set,  EMACS will
  1624. execute  set-encryption-key automatically, prompting you for the  needed
  1625. key.  Whenever EMACS prompts  you for a key, it will not echo the key to
  1626. your screen as you type  it (i.e make SURE you get it right when you set
  1627. it originally).
  1628.  
  1629.     The encryption algorithm used changes all characters into normal
  1630. printing characters, thus the resulting file is suitable for sending via
  1631. electronic mail.  All  version    of MicroEMACS should be able decrypt the
  1632. resulting file regardless of what  machine encrypted it.  Also available
  1633. with EMACS is the stand  alone program, MicroCRYPT, which can en/decrypt
  1634. the files produced by CRYPT mode in EMACS.
  1635.  
  1636.  
  1637. 7.4  EXACT mode
  1638.  
  1639.  
  1640.     All string searches and replacements will take    upper/lower case
  1641. into account. Normally the case of  a  string during a search or replace
  1642. is not taken into account.
  1643.  
  1644.  
  1645.  
  1646. 24
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653. MicroEMACS Reference Manual                       Modes
  1654.  
  1655.  
  1656. 7.5  MAGIC mode
  1657.  
  1658.  
  1659.     In the    MAGIC mode certain characters gain special meanings when
  1660. used  in  a  search  pattern.     Collectively  they  are know as regular
  1661. expressions, and a limited number of them are  supported  in MicroEmacs.
  1662. They grant greater flexibility when  using the search command.    However,
  1663. they do not affect the incremental search command.
  1664.  
  1665.     The symbols that have special meaning in MAGIC mode are ^, $, .,
  1666. *, [ (and ], used with it), and \.
  1667.  
  1668.     The characters ^ and  $  fix the search pattern to the beginning
  1669. and  end  of  line, respectively.  The ^ character must  appear  at  the
  1670. beginning of the search string,  and  the  $  must  appear  at    the end,
  1671. otherwise they loose their  meaning  and are treated just like any other
  1672. character.  For example,  in  MAGIC mode, searching for the pattern "t$"
  1673. would  put the cursor at the end of any line that ended with the  letter
  1674. 't'.  Note that this is  different  than searching for "t<NL>", that is,
  1675. 't' followed by a newline character.  The character $  (and  ^, for that
  1676. matter) matches a position, not a character, so the  cursor  remains  at
  1677. the end of the line.  But a newline is a character that must be matched,
  1678. just like any  other  character,  which  means that the cursor is placed
  1679. just after it - on the beginning of the next line.
  1680.  
  1681.     The character .  has a very simple  meaning  --  it  matches any
  1682. single character, except the newline.  Thus a search for  "bad.er" could
  1683. match "badger", "badder" (slang), or up to the 'r' of "bad error".
  1684.  
  1685.     The character * is known as closure, and means that zero or more
  1686. of  the  preceding  character  will  match.    If  there is no character
  1687. preceding,  * has no special meaning, and since it will not match with a
  1688. newline, * will have no special meaning if preceded by the  beginning of
  1689. line symbol ^ or the literal newline character <NL>.
  1690.  
  1691.     The notion of  zero  or  more  characters is important.  If, for
  1692. example, your cursor was on the line
  1693.  
  1694.      This line is missing two vowels.
  1695.  
  1696.     and a  search  was  made  for  "a*",  the cursor would not move,
  1697. because  it  is  guaranteed to match no letter 'a' , which satisfies the
  1698. search conditions.  If you wanted to  search  for  one    or  more  of the
  1699. letter 'a', you would search for "aa*", which would match the  letter a,
  1700. then zero or more of them.
  1701.  
  1702.     The character [ indicates  the    beginning  of a character class.
  1703. It  is    similar to the 'any' character ., but you get  to  choose  which
  1704. characters you want to match.  The character  class  is  ended    with the
  1705. character ].  So, while a  search  for "ba.e" will match "bane", "bade",
  1706. "bale", "bate",  et  cetera,  you  can    limit  it to matching "babe" and
  1707. "bake" by searching for "ba[bk]e".  Only one of  the  characters  inside
  1708. the [ and ] will match a character.  If in fact you  want  to  match any
  1709. character except those in the character  class,  you  can put a ^ as the
  1710.  
  1711.  
  1712.                                       25
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719. Modes                         MicroEMACS Reference Manual
  1720.  
  1721.  
  1722. first character.  It must be the first character of  the  class, or else
  1723. it has    no  special  meaning.    So, a search for [^aeiou] will match any
  1724. character except a vowel, but a search for [aeiou^] will match any vowel
  1725. or a ^.
  1726.  
  1727.     If you have a lot of characters in order that you want to put in
  1728. the  character class, you may use a dash (-) as a range character.   So,
  1729. [a-z] will match any letter (or any lower case letter  if  EXACT mode is
  1730. on),  and  [0-9a-f]  will match any digit or any letter 'a' through 'f',
  1731. which happen to be the characters for hexadecimal numbers.  If    the dash
  1732. is at the beginning or    end of a character class, it is taken to be just
  1733. a dash.
  1734.  
  1735.     The escape character \ is for those times when you want to be in
  1736. MAGIC  mode,  but  also want to use a regular expression character to be
  1737. just  a  character.   It turns off the special meaning of the character.
  1738. So  a search for "it\." will search for a line with "it.", and not  "it"
  1739. followed by any other character.  The escape character will also let you
  1740. put ^, -, or ] inside a character class with no special side effects.
  1741.  
  1742.  
  1743. 7.6  OVER mode
  1744.  
  1745.  
  1746.     OVER mode stands for overwrite mode.  When in  this  mode,  when
  1747. characters  are  typed,  instead of simply inserting them into the file,
  1748. EMACS  will  attempt  to overwrite an existing character past the point.
  1749. This is very useful for adjusting tables and diagrams.
  1750.  
  1751.  
  1752. 7.7  WRAP mode
  1753.  
  1754.  
  1755.     Wrap mode is used when typing in continuous text.   Whenever the
  1756. cursor is past the currently set fill column  (72  by  default)  and the
  1757. user types a space or  a <NL>, the last word of the line is brought down
  1758. to  the  beginning  of    the  next  line.  Using this, one just    types  a
  1759. continuous  stream of words and EMACS  automatically  inserts  <NL>s  at
  1760. appropriate places.
  1761.  
  1762.               NOTE to programmers:
  1763.  
  1764.      EMACS  actually calls up the function  bound  to  the  illegal
  1765.      keystroke M-FNW.  This is bound to the  function  wrap-word by
  1766.      default, but can be re-bound to  activate    different functions
  1767.      and macros at wrap time.
  1768.  
  1769.  
  1770. 7.8  VIEW mode
  1771.  
  1772.  
  1773.     VIEW mode disables all commands  which    can  change  the current
  1774. buffer.  EMACS will display an error message  and  ring  the  bell every
  1775. time you attempt to change a buffer in VIEW mode.
  1776.  
  1777.  
  1778. 26
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785. MicroEMACS Reference Manual                       Modes
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.                Chapter 7 Summary
  1793.  
  1794.  
  1795.     In Chapter 7 you learned about modes and their effects.
  1796.  
  1797. Key Binding        Keystroke               Effect
  1798. Add-Mode        ^X-M        Add a mode to the current buffer
  1799.  
  1800. Delete-Mode        ^X-^M        Delete a mode from the current buffer
  1801.  
  1802. Add-Global-Mode         M-M        Add a global mode to the
  1803.                     current buffer
  1804.  
  1805. Delete-Global-Mode    M-^M        Delete a global mode from the
  1806.                     current buffer
  1807.  
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.                                       27
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851. Files                         MicroEMACS Reference Manual
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.                    Chapter 8
  1861.  
  1862.                  Files
  1863.  
  1864.  
  1865.     A  file is simply a collection of related data.  In EMACS we are
  1866. dealing with text files -- named collections of text residing on  a disk
  1867. (or some other storage medium).  You will recall that the major entities
  1868. EMACS deals with  are  buffers.    Disk-based versions of files are only
  1869. active in EMACS when you are reading into or writing out of buffers.  As
  1870. we  have  already  seen,  buffers  and    physical  files  are  linked  by
  1871. associated  filenames.      For  example,  the buffer "ch7.txt"  which  is
  1872. associated with the physical disk file "ch7.txt." You  will  notice that
  1873. the file is usually specified by the drive  name  or  (in  the case of a
  1874. hard drive) a path.  Thus you can specify full filenames in EMACS,
  1875.  
  1876.     e.g. disk:\directories\filename.extension
  1877.  
  1878.     If you do not  specify    a disk and directories, the default disk
  1879. is used.
  1880.  
  1881.     IMPORTANT  -- If you do not explicitly save  your  buffer  to  a
  1882. file, all your edits will be  lost  when you leave EMACS (although EMACS
  1883. will prompt you  when  you  are  about    to  lose  edits by exiting).  In
  1884. addition, EMACS  does not protect your disk-based files from overwriting
  1885. when it saves files.  Thus when you  instruct  EMACS  to  save a file to
  1886. disk, it will create a file if the specified file  doesn't  exist, or it
  1887. will overwrite the previously saved version of the  file  thus replacing
  1888. it.  Your old version is gone forever.
  1889.  
  1890.     If you are at all  unsure  about  your    edits,    or  if    (for any
  1891. reason) you wish to keep previous versions of a file, you can change the
  1892. name of the associated file with  the  command    ^X-N.  When this file is
  1893. saved to disk, EMACS will create a new physical file under the new name.
  1894. The earlier disk file will be preserved.
  1895.  
  1896.     For example, let's load the file fang.txt into EMACS.  Now, type
  1897. ^X-N.  The EMACS command line prompts "name:".    Enter a new name for the
  1898. file -- say new.txt and press <NL>.  The file will  be    saved  under the
  1899. new filename, and  your  disk  directory  will    show  both  fang.txt and
  1900. new.txt.
  1901.  
  1902.     An  alternative method is to write the    file  directly    to  disk
  1903. under a new filename.  Let's pull our "publish.txt" file into EMACS.  To
  1904. write this file under  another    filename, type ^X-^W.  EMACS will prompt
  1905. you "write file:".  Enter an alternate filename --  desktop.txt.    Your
  1906. file will be saved as the physical file "desktop.txt".
  1907.  
  1908.  
  1909.  
  1910. 28
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917. MicroEMACS Reference Manual                       Files
  1918.  
  1919.  
  1920.     Note that in the examples above, although you  have  changed the
  1921. names of the related files, the buffer names remain the same.    However,
  1922. when  you pull the physical file back into EMACS, you will find that the
  1923. buffer name now relates to the filename.
  1924.  
  1925.     For example -- You are working with a buffer "fang.txt" with the
  1926. related file "fang.txt".  You change the name of the file  to "new.txt".
  1927. EMACS now shows you  working  with the buffer "fang.txt" and the related
  1928. file  "new.txt".    Now pull the file "new.txt" into EMACS.  Notice that
  1929. the buffer name has now changed to "new.txt".
  1930.  
  1931.     If for any reason a conflict of buffer names occurs,(if you have
  1932. files of  the  same  name  on  different  drives for example) EMACS will
  1933. prompt you "use buffer:".  Enter an alternative buffer name if    you need
  1934. to.
  1935.  
  1936.     For  a    list  of  file    related commands (including  some  we`ve
  1937. already seen), see the summary page.
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.                                       29
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983. Files                         MicroEMACS Reference Manual
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.                Chapter 8 Summary
  1991.  
  1992.  
  1993.     In Chapter 8 you  learned  some of the more advanced concepts of
  1994. file  naming  and  manipulation.    The relationship between  files  and
  1995. buffers was discussed in some detail.
  1996.  
  1997. Key Binding    Keystroke    Effect
  1998.  
  1999. Save-file    ^X-^S        Saves contents of current buffer with
  2000.                 associated filename on default disk/
  2001.                 directory (if not specified)
  2002.  
  2003. Write-File    ^X-^W        Current buffer contents will be
  2004.                 saved under specified name
  2005.  
  2006. Change-File-name
  2007.         ^X-N        The associated filename is changed
  2008.                 (or associated if not previously
  2009.                 specified) as specified
  2010.  
  2011. Find-File    ^X-^F        Reads specified file into buffer and
  2012.                 switches you to that buffer, or switches
  2013.                 to buffer in which the file has previously
  2014.                 been read
  2015.  
  2016. Read-File    ^X-^R        Reads file into buffer thus overwriting
  2017.                 buffer contents.  If file has already
  2018.                 been read into another buffer, you will
  2019.                 be switched to it
  2020.  
  2021. View-File    ^X-^V        The same as read-file except the buffer
  2022.                 is automatically put into VIEW mode thus
  2023.                 preventing any changes from being made
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042. 30
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049. MicroEMACS Reference Manual                   Screen Formatting
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.                    Chapter 9
  2059.  
  2060.                Screen Formatting
  2061.  
  2062.  
  2063. 9.1  Wrapping Text
  2064.  
  2065.  
  2066.     As  we    learned  in  the  introduction,  EMACS    is  not  a  word
  2067. processor, but an editor.   Some simple formatting options are available
  2068. however, although in most  cases  they will not affect the appearance of
  2069. the finished text when it is run through the formatter.  We have already
  2070. encountered WRAP mode which  wraps  lines  longer  than a certain length
  2071. (default is 75 characters).  You will recall  that  WRAP  is  enabled by
  2072. entering ^X-M and responding to the command line prompt with wrap.
  2073.  
  2074.     You can also set your own wrap margin with the command ^X-F set-
  2075. fill-column.  Notice EMACS responds "[Fill column is 1]." Now try typing
  2076. some text.   You'll  notice  some  very strange things happening -- your
  2077. text wraps  at    every  word!!  This  effect  occurs because the set wrap
  2078. margin command must be preceded by  a  numeric argument or EMACS sets it
  2079. to the first column.  Thus any text you type that extends past the first
  2080. column will wrap at the most convenient line break.
  2081.  
  2082.     To reset the wrap column to 72 characters, press the  <META> key
  2083. and enter 72.  EMACS will respond "Arg:  72".     Now  press ^X-F.  EMACS
  2084. will respond "[Fill column is 72]".    Your  text will again wrap at the
  2085. margin you've been using up to this point.
  2086.  
  2087.  
  2088. 9.2  Reformatting Paragraphs
  2089.  
  2090.  
  2091.     After an intensive editing session, you may find  that    you have
  2092. paragraphs  containing    lines  of  differing  lengths.      Although  this
  2093. disparity will not affect  the    formatted  text, aesthetic and technical
  2094. concerns  may  make  it desirable to have consistent paragraph blocks on
  2095. the screen.   If you are in WRAP mode, you can reformat a paragraph with
  2096. the  command  M-Q  fill-paragraph.    This command 'fills'  the  current
  2097. paragraph  reformatting  it  so  all  the  lines  are  filled  and  wrap
  2098. logically.    The  process  is    complex,  and  (especially  with  longer
  2099. paragraphs) may take a little time.
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.                                       31
  2109.  
  2110.  
  2111.  
  2112.  
  2113. Screen Formatting                 MicroEMACS Reference Manual
  2114.  
  2115.  
  2116. 9.3  Changing Case
  2117.  
  2118.  
  2119.     There may be occasions when you find it necessary to  change the
  2120. case of the text you've entered.  EMACS allows you to change the case of
  2121. even large amounts of text with ease.  Let's try and  convert  a  few of
  2122. the office traditionalists to the joy  of  word processing.  Type in the
  2123. following text:
  2124.  
  2125.      Throw away your typewriter and  learn to use a word processor.
  2126.      Word processing  is relatively easy to learn and will increase
  2127.      your productivity enormously.  Enter the Computer Age and find
  2128.      out just how much fun it can be!!
  2129.  
  2130.     Let's give it a  little  more  impact  by capitalizing the first
  2131. four words.  The first    step is to define the region of text just as you
  2132. would  if  you were doing an extensive deletion.  Set the  mark  at  the
  2133. beginning of the paragraph with M-<space> set-mark and    move  the cursor
  2134. to the space beyond  "typewriter."  Now  enter    ^X-^U case-region-upper.
  2135. Your text should now look like this:
  2136.  
  2137.      THROW AWAY YOUR TYPEWRITER and  learn to use a word processor.
  2138.      Word processing  is relatively easy to learn and will increase
  2139.      your productivity enormously.  Enter the Computer Age and find
  2140.      out just how much fun it can be!!
  2141.  
  2142.     If  you  want  to change the text back to lower case, type ^X-^L
  2143. case-region-lower.    You  can    also  capitalize individual words.    To
  2144. capitalize the word "fun", position the cursor in front of the    word and
  2145. type  M-U  case-word-upper.   The word is now capitalized.  To change it
  2146. back to lower case, move the  cursor  back  to the beginning of the word
  2147. and type M-L case-word-lower.
  2148.  
  2149.     You  may  also    capitalize  individual    letters in EMACS.    The
  2150. command M-C case-word-capitalize capitalizes the first letter  after the
  2151. point.    This command would normally be issued with the cursor positioned
  2152. in front of the first letter of the word you wish to capitalize.  If you
  2153. issue it  in  the  middle  of  a  word, you can end up with some strAnge
  2154. looking text.
  2155.  
  2156.  
  2157. 9.4  Tabs
  2158.  
  2159.  
  2160.     Unless    your  formatter  is  instructed  to  take   screen  text
  2161. literally  (as    MicroSCRIBE  does  in  the  'verbatim'    environment  for
  2162. example), tabs in EMACS generally affect screen formatting only.
  2163.  
  2164.     When EMACS is first started, it sets the default  tab  to  every
  2165. eighth column.    As long as you stay with default,  every  time you press
  2166. the tab key a tab character, ^I is inserted.  This character, like other
  2167. control  characters,  is  invisible  --   but  it  makes  a  subtle  and
  2168. significant difference to your file and editing.
  2169.  
  2170.  
  2171.  
  2172. 32
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179. MicroEMACS Reference Manual                   Screen Formatting
  2180.  
  2181.  
  2182.     For example, in default mode, press the tab key  and  then  type
  2183. the word Test.    "Test" appears at the eighth column.    Move your cursor
  2184. to the beginning of the word and delete  the  backward    character.   The
  2185. word doesn't  move  back  just    one  character,  but flushes to the left
  2186. margin.    The    reason for this behavior is easily explained.     In  tab
  2187. default, EMACS inserts    a  'real'  tab    character when you press the tab
  2188. key.  This character is inserted at the default position, but  NO SPACES
  2189. are inserted between the  tab  character and the margin (or previous tab
  2190. character).  As you will  recall, EMACS only recognizes characters (such
  2191. as  spaces  or    letters) and thus when the tab character is removed, the
  2192. text beyond the tab is flushed back to the margin or previous tab mark.
  2193.  
  2194.     This situation changes if you alter  the  default configuration.
  2195. The default value may  be  changed by entering a numeric argument before
  2196. pressing  the  tab key.  As we saw earlier, pressing the  META    key  and
  2197. entering a  number  allows  you  to  specify  how EMACS performs a given
  2198. action.   In this case, let's specify an argument of 10 and hit the  tab
  2199. key.
  2200.  
  2201.     Now hit the tab key again  and    type  Test.  Notice the word now
  2202. appears at the    tenth column.  Now move to the beginning of the word and
  2203. delete the backward character. "Test" moves back by one character.
  2204.  
  2205.     EMACS behaves differently in these circumstances because  the ^I
  2206. handle-tab function deals with tabbing in two distinct ways.  In default
  2207. conditions,  or  if  the  numeric  argument of zero is used,  handle-tab
  2208. inserts a true tab character.  If, however, a non-zero    numeric argument
  2209. is specified, handle-tab inserts the  correct number of spaces needed to
  2210. position the cursor at the next specified tab  position.    It    does NOT
  2211. insert the single tab character and hence any  editing    functions should
  2212. take account of the number of spaces between tabbed columns.
  2213.  
  2214.     Many times you would like to take a line which has  been created
  2215. using the tab character and change it to use just  spaces.   The command
  2216. ^X-^D  detab-line  changes  any tabs from the point to the  end  of  the
  2217. current line into the right  number  of  spaces  so  the  line    does not
  2218. change.  This  is very useful for times when the file must be printed or
  2219. transferred to a machine which does not understand tabs.
  2220.  
  2221.     Also, the inverse command,  ^X-^E  entab-lines    changes multiple
  2222. spaces to tabs where possible.    This is a good way to shrink the size of
  2223. large  documents,  especially  with data tables.  Both of these commands
  2224. can take a numeric argument which  will  be interpreted as the number of
  2225. lines to en/detab.
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.                                       33
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245. Screen Formatting                 MicroEMACS Reference Manual
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.                Chapter 9 Summary
  2253.  
  2254.  
  2255.     In  Chapter  9    introduced some of the    formatting  features  of
  2256. EMACS. Text-wrap, paragraph reformatting,  and    tabs  were  discussed in
  2257. some  detail.     The commands in the following table were covered in the
  2258. chapter.
  2259.  
  2260.  
  2261. Key Binding        Keystroke            Effect
  2262. Add-Mode/WRAP        ^X-M[WRAP]    Add wrap mode to current buffer
  2263.  
  2264. Delete-Mode/WRAP    ^X-^M[WRAP]    Remove wrap mode from current buffer
  2265.  
  2266. Set-Fill-Column         ^X-F        Set fill column to given numeric
  2267.                     argument
  2268.  
  2269. Fill-Paragraph        M-Q        Logically reformats the current
  2270.                     paragraph
  2271.  
  2272. Case-Word-Upper         M-U        Text from point to end of the
  2273.                     current word is changed to uppercase
  2274.  
  2275. Case-Word-Lower         M-L        Text from point to end of the
  2276.                     current word is changed to lowercase
  2277.  
  2278. Case-Word-Capitalize    M-C        First word (or letter) after the
  2279.                     point is capitalized
  2280.  
  2281. Case-Region-Upper    ^X-^U        The current region is uppercased
  2282.  
  2283. Case-Region-Lower    ^X-^L        The current region is lowercased
  2284.  
  2285. Handle-Tab        ^I        Tab interval is set to the given
  2286.                     numeric argument
  2287. Entab-Line        ^X-^E        Changes multiple spaces to tabs
  2288.                     characters where possible
  2289. Detab-Line        ^X-^D        Changes tab characters to the
  2290.                     appropriate number of spaces
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304. 34
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311. MicroEMACS Reference Manual                 Keyboard Macros
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.                    Chapter 10
  2321.  
  2322.                 Keyboard Macros
  2323.  
  2324.  
  2325.     In many applications, it may be necessary to repeat a  series of
  2326. characters or commands frequently.  For example, a paper may require the
  2327. frequent repetition of a complex formula or a long name.    You may also
  2328. have a series of EMACS commands that you invoke  frequently.    Keyboard
  2329. macros    offer  a  convenient  method  of recording and    repeating  these
  2330. commands.
  2331.  
  2332.     Imagine,  for  example,  you are writing a  scholarly  paper  on
  2333. Asplenium platyneuron, the spleenwort fern.  Even the dedicated botanist
  2334. would  probably  find  it  a  task  bordering  on  the agonizing to type
  2335. Asplenium platyneuron frequently throughout the paper.      An alternative
  2336. method is 'record' the name in a keyboard macro.  Try it yourself.
  2337.  
  2338.     The  command  ^X-(  begin-macro  starts  recording  the  all the
  2339. keystrokes  and  commands  you input.    After  you've  typed  it,  enter
  2340. Asplenium platyneuron.    To stop recording, type ^X-)  end-macro.   EMACS
  2341. has stored all the keystrokes between  the  two commands.  To repeat the
  2342. name  you've  stored,  just  enter  ^X-E  execute-macro,  and  the  name
  2343. "Asplenium platyneuron" appears.  You can repeat this action as often as
  2344. you want, and of course as  with  any  EMACS command, you may precede it
  2345. with a numerical argument.
  2346.  
  2347.     Because  EMACS    records  keystrokes,  you  may    freely    intermix
  2348. commands and text.  Unfortunately, you can only  store    one  macro  at a
  2349. time.     Thus, if you begin to    record    another  macro,  the  previously
  2350. defined macro is lost. Be careful to ensure that  you've  finished  with
  2351. one macro before defining another.  If you  have  a  series  of commands
  2352. that  you  would  like    to  'record'  for  future use, use the macro  or
  2353. procedure facilities detailed in chapter <X>.
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.                                       35
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377. Keyboard Macros                              MicroEMACS Reference Manual
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.                Chapter 10 Summary
  2385.  
  2386.  
  2387.     Chapter 10 covered keyboard macros.  You learned  how  to record
  2388. keystrokes and how to repeat the stored sequence.
  2389.  
  2390. Key Binding        Keystroke        Effect
  2391.  
  2392. Start-Macro        ^X-(        Starts recording all keyboard input
  2393.  
  2394. End-Macro        ^X-)        Stops recording keystrokes for macro
  2395.  
  2396. Execute-Macro        ^X-E        Entire sequence of recorded
  2397.                     keystrokes is replayed
  2398.  
  2399.  
  2400.  
  2401.  
  2402.  
  2403.  
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436. 36
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443. MicroEMACS Reference Manual                   MicroEMACS Macros
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.                    Chapter 11
  2453.  
  2454.                MicroEMACS Macros
  2455.  
  2456.  
  2457.     Macros are programs that are used to customize the editor and to
  2458. perform complicated  editing  tasks.    They  may  be stored in files or
  2459. buffers and may be executed using an appropriate command, or bound  to a
  2460. particular  keystroke.      Portions  of    the standard start-up  file  are
  2461. implement via macros, as well as the example menu system.   The execute-
  2462. macro-<n>  commands  cause  the  macro,  numbered  from  1  to 40, to be
  2463. executed.  The execute-file command allows you to execute a macro stored
  2464. in a disk file, and the  execute-buffer  command allows you to execute a
  2465. macro  stored  in  a buffer.  Macros are stored for  easy  execution  by
  2466. executing files that contain the store-macro command.
  2467.  
  2468.     There are many different  aspects  to  the macro language within
  2469. MicroEMACS.  Editor commands  are  the    various commands that manipulate
  2470. text, buffers, windows, etc, within the editor.  Directives are commands
  2471. which  control    what  lines get executed within a macro.  Also there are
  2472. various types of variables.    Environmental  variables both control and
  2473. report on different aspects  of  the editor.  User variables hold string
  2474. values which may be changed and inspected.  Buffer variables  allow text
  2475. to be placed into variables.  Interactive variable allow the  program to
  2476. prompt the user for information.  Functions can be  used  to  manipulate
  2477. all these variables.
  2478.  
  2479.  
  2480. 11.1  Variables
  2481.  
  2482.  
  2483.     Variables  in MicroEMACS can be used  to  return  values  within
  2484. expressions,  as repeat counts to editing commands, or    as  text  to  be
  2485. inserted into buffers and messages.  The value of these variables is set
  2486. using the set  (^X-A)  command.    For    example, to set the current fill
  2487. column to 64 characters, the following macro line would be used:
  2488.  
  2489.     set $fillcol 64
  2490.  
  2491.     or  to    have  the contents of %name inserted at the point in the
  2492. current buffer, the command to use would be:
  2493.  
  2494.     insert-string %name
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.                                       37
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509. MicroEMACS Macros                 MicroEMACS Reference Manual
  2510.  
  2511.  
  2512.  
  2513. 11.1.1    Environmental Variables
  2514.  
  2515.  
  2516.     "What good is a quote if you can't change it?"
  2517.  
  2518.     These variables are used to  change different aspects of the way
  2519. the editor works.  Also they will return the current settings if used as
  2520. part of an expression.    All environmental variable names  begin  with  a
  2521. dollar sign ($) and are in lower case.
  2522.  
  2523. $fillcol     Current fill column
  2524.  
  2525. $pagelen     Number of screen lines used currently
  2526.  
  2527. $curwidth     Number of columns used currently
  2528.  
  2529. $curcol          Current column of point in current buffer
  2530.  
  2531. $curline     Current line of point in current buffer
  2532.  
  2533. $flicker     Flicker Flag set to TRUE if IBM CGA set  to  FALSE  for
  2534.          most others
  2535.  
  2536. $cbufname     Name of the current buffer
  2537.  
  2538. $cfname          File name of the current buffer
  2539.  
  2540. $sres         Current screen resolution (CGA, MONO or EGA on the IBM-
  2541.          PC  driver. LOW, MEDIUM, HIGH or  DENSE  on  the  Atari
  2542.          ST1040, NORMAL on all others)
  2543.  
  2544. $debug         Flag to trigger macro debugging (try it...  you'll like
  2545.          it!)
  2546.  
  2547. $status          return status    of the success of the last command (TRUE
  2548.          or FALSE) usually used with !force
  2549.  
  2550. $palette     string used to control the palette register settings on
  2551.          graphics versions. The  usually form consists of groups
  2552.          of three  octal digits setting the red, green, and blue
  2553.          levels.
  2554.  
  2555. $asave         The number  of  inserted  characters  between automatic
  2556.          file-saves in ASAVE mode.
  2557.  
  2558. $acount          The  countdown  of  inserted  characters until the next
  2559.          save-file.
  2560.  
  2561. $lastkey     Last keyboard character typed
  2562.  
  2563. $curchar     Character currently at the point
  2564.  
  2565.  
  2566.  
  2567.  
  2568. 38
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575. MicroEMACS Reference Manual                   MicroEMACS Macros
  2576.  
  2577.  
  2578. $discmd          Flag to  disable the echoing of messages on the command
  2579.          line
  2580.  
  2581. $version     Contains the current MicroEMACS version number
  2582.  
  2583. $progname     Always  contains  the    string "MicroEMACS" for standard
  2584.          MicroEMACS. Could  be something else if used as part of
  2585.          someone else's program
  2586.  
  2587. $seed         integer seed of the random number generator
  2588.  
  2589. $disinp          Flag  to  disable  the  echoing  of  characters  during
  2590.          command line input
  2591.  
  2592.     Obviously, many more of these  variables  will    be  available in
  2593. future releases of MicroEMACS.    (Yes,  send a vote for your favorite new
  2594. environmental variables today).
  2595.  
  2596.  
  2597. 11.1.2    User variables
  2598.  
  2599.  
  2600.     User  variables  allow    you,  the  user,  to  store strings  and
  2601. manipulate them.  These strings can be pieces of text, numbers    (in text
  2602. form), or the logical values TRUE and FALSE.    These  variables  can be
  2603. combined, tested, inserted  into  buffers, and otherwise used to control
  2604. the way your macros execute.   At  the    moment, up to 100 user variables
  2605. may be    in  use  in  one editing session.  All users variable names must
  2606. begin with a percent  sign  (%) and may contain any printing characters.
  2607. Only the first 10 characters are significant (i.e differences beyond the
  2608. tenth character are ignored).  Most operators will truncate strings to a
  2609. length of 128 characters.
  2610.  
  2611.  
  2612. 11.1.3    Buffer Variables
  2613.  
  2614.  
  2615.     Buffer    variables  are    special in that they can only be queried
  2616. and cannot be set.  What buffer variables are is a way to take text from
  2617. a buffer and place it  in a variable. For example, if I have a buffer by
  2618. the name of RIGEL2, and it contains the text:
  2619.  
  2620.     Richmond
  2621.     Lafayette
  2622.     <*>Bloomington        (where <*> is the current point)
  2623.     Indianapolis
  2624.     Gary
  2625.     =* MicroEMACS 3.8i (WRAP) == rigel2 == File: /data/rigel2.txt =====
  2626.  
  2627.     and within a command I reference #rigel2, like:
  2628.  
  2629.     insert-string #rigel2
  2630.  
  2631.  
  2632.  
  2633.  
  2634.                                       39
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641. MicroEMACS Macros                 MicroEMACS Reference Manual
  2642.  
  2643.  
  2644.     MicroEMACS would start at the current point in the RIGEL2 buffer
  2645. and  grab  all the text up to the end of that line and pass  that  back.
  2646. Then it would advance the point to the beginning of the next line. Thus,
  2647. after our  last command executes, the string "Bloomington" gets inserted
  2648. into the current buffer, and the buffer RIGEL2 now looks like this:
  2649.  
  2650.     Richmond
  2651.     Lafayette
  2652.     Bloomington
  2653.     <*>Indianapolis         (where <*> is the current point)
  2654.     Gary
  2655.     =* MicroEMACS 3.8i (WRAP) == rigel2 == File: /data/rigel2.txt =====
  2656.  
  2657.     as you have probably noticed,  a buffer variable consists of the
  2658. buffer name, preceded by a pound sign (#).
  2659.  
  2660.  
  2661. 11.1.4    Interactive variables
  2662.  
  2663.  
  2664.     Interactive variables are  actually  a method to prompt the user
  2665. for a string.  This is done by using an at sign (@) followed either with
  2666. a quoted string, or a variable containing a string.   The  string is the
  2667. placed on the  bottom line, and the editor waits for the user to type in
  2668. a string.  Then the  string  typed  in    by  the users is returned as the
  2669. value of the interactive variable.  For example:
  2670.  
  2671.     set %quest "What file? "
  2672.     find-file @%quest
  2673.  
  2674.     will ask the user for a file name, and then attempt to find it.
  2675.  
  2676.  
  2677. 11.2  Functions
  2678.  
  2679.  
  2680.     Functions can be  used    to manipulate variables in various ways.
  2681. Functions can have one,  two,  or three arguments.  These arguments will
  2682. always    be  placed  after the function on the current command line.  For
  2683. example, if we wanted to increase the current fill column by  two, using
  2684. emacs's set (^X-A) command, we would write:
  2685.  
  2686.     set $fillcol &add $fillcol 2
  2687.      \    \      \      \     \____second operand
  2688.       \     \    \      \_________first operand
  2689.        \      \     \_______________function to execute
  2690.         \       \_____________________variable to set
  2691.          \___________________________set (^X-A) command
  2692.  
  2693.     Function names always begin with  the  ampersand  (&) character,
  2694. and  are  only    significant to the  first  three  characters  after  the
  2695. ampersand.    Functions  will  normal  expect  one  of    three  types  of
  2696. arguments, and will automatically convert types when needed.
  2697.  
  2698.  
  2699.  
  2700. 40
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707. MicroEMACS Reference Manual                   MicroEMACS Macros
  2708.  
  2709.  
  2710. <num>         an ascii string of digits  which  is  interpreted  as a
  2711.          numeric value.  Any string  which does not start with a
  2712.          digit or a minus sign (-) will be considered zero.
  2713.  
  2714. <str>         An arbitrary string  of  characters.     At  the moment,
  2715.          strings are limited to 128 characters in length.
  2716.  
  2717. <log>         A logical value  consisting  of  the  string  "TRUE" or
  2718.          "FALSE".  Numeric strings will also evaluate to "FALSE"
  2719.          if they are equal to zero, and "TRUE" if they    are non-
  2720.          zero.    Arbitrary text    strings  will  have the value of
  2721.          "FALSE".
  2722.  
  2723.     A list    of  the  currently  available  functions  follows: (Once
  2724. again, send in those votes on what kind of functions  you  would like to
  2725. see  added!)  Functions  are  always  used in lower case, the  uppercase
  2726. letters  in  the  function table are the short form of the function (i.e
  2727. &div for ÷).
  2728.  
  2729. Numeric Functions:    (returns <num>)
  2730.  
  2731. &ADD        <num> <num>    Add two numbers
  2732. &SUB        <num> <num>    Subtract the second number from the first
  2733. &TIMes        <num> <num>    Multiply two numbers
  2734. &DIVide         <num> <num>    Divide the first number by the second
  2735.                 giving an integer result
  2736. &MOD        <num> <num>    Return the reminder of dividing the
  2737.                 first number by the second
  2738. &NEGate         <neg>        Multiply the arg by -1
  2739. &LENgth         <str>        Returns length of string
  2740. &ASCii        <str>        Return the ascii code of the first
  2741.                 character in <str>
  2742. &RND        <num>        Returns a random integer between 1 and <num>
  2743. &ABS        <num>        Returns the absolute value of <num>
  2744.  
  2745. String manipulation functions:    (returns <str>)
  2746.  
  2747. &CAT        <str> <str>    Concatenate the two strings to form one
  2748. &LEFt        <str> <num>    return the <num> leftmost characters
  2749.                 from <str>
  2750. &RIGht        <str> <num>    return the <num> rightmost characters
  2751.                 from <str>
  2752. &MID        <str> <num1> <num2>
  2753.                 Starting from <num1> position in <str>,
  2754.                 return <num2> characters.
  2755. &UPPer        <str>        Uppercase <str>
  2756. &LOWer        <str>        lowercase <str>
  2757. &CHR        <num>        return a string with the character
  2758.                 represented by ascii code <num>
  2759. >K                return a string containing a single
  2760.                 keystroke from the user
  2761.  
  2762. Logical Testing functions:    (returns <log>)
  2763.  
  2764.  
  2765.  
  2766.                                       41
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773. MicroEMACS Macros                 MicroEMACS Reference Manual
  2774.  
  2775.  
  2776. &NOT        <log>        Return the opposite logical value
  2777. &AND        <log1> <log2>    Returns TRUE if BOTH logical arguments
  2778.                 are TRUE
  2779. &OR        <log1> <log2>    Returns TRUE if either argument
  2780.                 is TRUE
  2781. &EQUal        <num> <num>    If <num> and <num> are numerically
  2782.                 equal, return TRUE
  2783. &LESs        <num1> <num2>    If <num1> is less than <num2>, return
  2784.                 TRUE.
  2785. &GREater    <num1> <num2>    If <num1> is greater than, or equal to
  2786.                 <num2>, return TRUE.
  2787. &SEQual         <str1> <str2>    If the two strings are the same, return
  2788.                 TRUE.
  2789. &SLEss        <str1> <str2>    If <str1> is less alphabetically than
  2790.                 <str2>, return TRUE.
  2791. &SGReater    <str1> <str2>    If <str1> is alphabetically greater than
  2792.                 or equal to <str2>, return TRUE.
  2793.  
  2794. Special Functions:
  2795.  
  2796. &INDirect    <str>        Evaluate <str> as a variable.
  2797.  
  2798.     This last function deserves more explanation. The  &IND function
  2799. evaluates its argument, takes the resulting string, and then uses  it as
  2800. a variable name.  For example, given the following code sequence:
  2801.  
  2802.     ; set up reference table
  2803.  
  2804.     set %one    "elephant"
  2805.     set %two    "giraffe"
  2806.     set %thee    "donkey"
  2807.  
  2808.     set %index "two"
  2809.     insert-string &ind %index
  2810.  
  2811.     the  string  "giraffe"    would have been inserted at the point in
  2812. the current buffer.  This indirection  can  be safely nested up to about
  2813. 10 levels.
  2814.  
  2815.  
  2816. 11.3  Directives
  2817.  
  2818.  
  2819.     Directives are commands which only operate  within  an executing
  2820. macro, i.e  they  do  not  make sense as a single command. As such, they
  2821. cannot be called up singly or bound to keystroke.  Used  within  macros,
  2822. they control what lines are executed and in what order.
  2823.  
  2824.     Directives always start with the exclamation mark  (!) character
  2825. and must be the first thing placed on a line. Directives executed singly
  2826. (via the execute-command-line command) interactively will be ignored.
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832. 42
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839. MicroEMACS Reference Manual                   MicroEMACS Macros
  2840.  
  2841.  
  2842.  
  2843. 11.3.1    !ENDM Directive
  2844.  
  2845.  
  2846.     This  directive  is  used to terminate a macro being stored. For
  2847. example, if a file is being executed contains the text:
  2848.  
  2849.     ;    Read in a file in view mode, and make the window red
  2850.  
  2851.     26    store-macro
  2852.         find-file @"File to view: "
  2853.         add-mode "view"
  2854.         add-mode "red"
  2855.     !endm
  2856.  
  2857.     write-message "[Consult macro has been loaded]"
  2858.  
  2859.     only the lines between the  store-macro  command  and  the !ENDM
  2860. directive are stored in macro 26.
  2861.  
  2862.  
  2863. 11.3.2    !FORCE Directive
  2864.  
  2865.  
  2866.     When  MicroEMACS executes a macro, if  any  command  fails,  the
  2867. macro is  terminated  at  that    point. If a line is preceded by a !FORCE
  2868. directive, execution  continues weather the command succeeds or not. For
  2869. example:
  2870.  
  2871.     ;    Merge the top two windows
  2872.  
  2873.     save-window        ;remember what window we are at
  2874.     1 next-window        ;go to the top window
  2875.     delete-window        ;merge it with the second window
  2876.     !force restore-window    ;This will continue regardless
  2877.     add-mode "red"
  2878.  
  2879.  
  2880. 11.3.3    !IF, !ELSE, and !ENDIF Directives
  2881.  
  2882.  
  2883.     This  directive  allows  statements  only  to be executed  if  a
  2884. condition specified in the  directive  is met.    Every line following the
  2885. !IF directive, until  the  first  !ELSE  or  !ENDIF  directive,  is only
  2886. executed  if  the  expression following the !IF directive evaluates to a
  2887. TRUE value.   For  example,  the  following  macro  segment  creates the
  2888. portion of a text file automatically.  (yes  believe  me,  this  will be
  2889. easier to understand then that last explanation....)
  2890.  
  2891.     !if &sequal %curplace "timespace vortex"
  2892.         insert-string "First, rematerialize~n"
  2893.     !endif
  2894.     !if &sequal %planet "earth"    ;If we have landed on earth...
  2895.  
  2896.  
  2897.  
  2898.                                       43
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905. MicroEMACS Macros                 MicroEMACS Reference Manual
  2906.  
  2907.  
  2908.         !if &sequal %time "late 20th century"  ;and we are then
  2909.             write-message "Contact U.N.I.T."
  2910.         !else
  2911.             insert-string "Investigate the situation....~n"
  2912.             insert-string "(SAY 'stay here Sara')~n"
  2913.         !endif
  2914.     !else
  2915.         set %conditions @"Atmosphere conditions outside? "
  2916.         !if &sequal %conditions "safe"
  2917.             insert-string &cat "Go outside......" "~n"
  2918.             insert-string "lock the door~n"
  2919.         !else
  2920.             insert-string "Dematerialize..try somewhere else"
  2921.             newline
  2922.         !endif
  2923.     !endif
  2924.  
  2925.  
  2926. 11.3.4    !GOTO Directive
  2927.  
  2928.  
  2929.     Flow can be controlled within a MicroEMACS macro using the !GOTO
  2930. directive. It takes as an argument a label. A label  consists  of a line
  2931. starting  with an asterisk (*) and then an  alphanumeric  label.    Only
  2932. labels in the currently executing macro can be jumped to, and  trying to
  2933. jump to  a  non-existing  label  terminates  execution    of a macro.  For
  2934. example..
  2935.  
  2936.     ;Create a block of DATA statements for a BASIC program
  2937.  
  2938.         insert-string "1000 DATA "
  2939.         set %linenum 1000
  2940.  
  2941.     *nxtin
  2942.         update-screen        ;make sure we see the changes
  2943.         set %data @"Next number: "
  2944.         !if &equal %data 0
  2945.             !goto finish
  2946.         !endif
  2947.  
  2948.         !if &greater $curcol 60
  2949.             2 delete-previous-character
  2950.             newline
  2951.             set %linenum &add %linenum 10
  2952.             insert-string &cat %linenum " DATA "
  2953.         !endif
  2954.  
  2955.         insert-string &cat %data ", "
  2956.         !goto nxtin
  2957.  
  2958.     *finish
  2959.  
  2960.         2 delete-previous-character
  2961.  
  2962.  
  2963.  
  2964. 44
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971. MicroEMACS Reference Manual                   MicroEMACS Macros
  2972.  
  2973.  
  2974.         newline
  2975.  
  2976.  
  2977. 11.3.5    !RETURN Directive
  2978.  
  2979.  
  2980.     The !RETURN Directive  causes  the current macro to exit, either
  2981. returning to the caller (if any) or to interactive mode.  For example:
  2982.  
  2983.     ;    Check the monitor type and set %mtyp
  2984.  
  2985.     !if &sres "CGA"
  2986.         set %mtyp 1
  2987.         !return
  2988.     !else
  2989.         set %mtyp 2
  2990.     !endif
  2991.  
  2992.     insert-string "You are on a MONOCHROME machine!~n"
  2993.  
  2994.  
  2995.  
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.                                       45
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037. A                         MicroEMACS Reference Manual
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.                    Appendix A
  3047.  
  3048.               MicroEMACS commands
  3049.  
  3050.  
  3051.     Below  is a complete list of the commands  in  EMACS,  the  keys
  3052. normally used to do the command,  and  what the command does.  Remember,
  3053. on some computers there may also  be  additional ways of using a command
  3054. (cursor keys and special function keys for example).
  3055.  
  3056. Command                 Binding         Meaning
  3057. abort-command         ^G    This allows the user to abort out of any
  3058.                 command that is waiting for input
  3059.  
  3060. add-mode         ^X-M    Add a mode to the current buffer
  3061.  
  3062. add-global-mode          M-M    Add a global mode for all new buffers
  3063.  
  3064. apropos                  M-A    List out commands whose name contains
  3065.                 the string specified
  3066.  
  3067. backward-character     ^B    Move one character to the left
  3068.  
  3069. begin-macro         ^X-(    Begin recording a keyboard macro
  3070.  
  3071. beginning-of-file     M-<    Move to the beginning of the file in
  3072.                 the current buffer
  3073.  
  3074. beginning-of-line     ^A    Move to the beginning of the current line
  3075.  
  3076. bind-to-key         M-K    Bind a key to a function
  3077.  
  3078. buffer-position          ^X-=    List the position of the cursor in the
  3079.                 current window on the command line
  3080.  
  3081. case-region-lower     ^X-^L    Make a marked region all lower case
  3082.  
  3083. case-region-upper     ^X-^U    Make a marked region all upper case
  3084.  
  3085. case-word-capitalize     M-C    Capitalize the following word
  3086.  
  3087. case-word-lower          M-L    Lower case the following word
  3088.  
  3089. case-word-upper          M-U    Upper case the following word
  3090.  
  3091. change-file-name     ^X-N    Change the name of the file in the
  3092.                 current buffer
  3093.  
  3094.  
  3095.  
  3096. 46
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103. MicroEMACS Reference Manual                           A
  3104.  
  3105.  
  3106. change-screen-size     M-^S    Change the number of lines of the screen
  3107.                 currently being used
  3108.  
  3109. change-screen-width     M-^T    Change the number of columns of the
  3110.                 screen currently being used
  3111.  
  3112. clear-and-redraw     ^L    Clear the physical screen and redraw it
  3113.  
  3114. clear-message-line    (none)    Clear the command line
  3115.  
  3116. copy-region         M-W    Copy the currently marked region into
  3117.                 the kill buffer
  3118.  
  3119. count-words         M-^C    Count how many words, lines and
  3120.                 characters are in the current marked region
  3121.  
  3122. ctlx-prefix         ^X    Change the key used as the ^X prefix
  3123.  
  3124. delete-blank-lines     ^X-^O    Delete all blank lines around the cursor
  3125.  
  3126. delete-buffer         ^X-K    Delete a buffer which is not being
  3127.                 currently displayed in a window
  3128.  
  3129. delete-mode         ^X-^M    Turn off a mode in the current buffer
  3130.  
  3131. delete-global-mode     M-^M    Turn off a global mode
  3132.  
  3133. delete-next-character     ^D    Delete the character following the cursor
  3134.  
  3135. delete-next-word     M-D    Delete the word following the cursor
  3136.  
  3137. delete-other-windows     ^X-1    Make the current window cover the entire
  3138.                 screen
  3139.  
  3140. delete-previous-character^H    Delete the character to the left of the
  3141.                 cursor
  3142.  
  3143. delete-previous-word     M-^H    Delete the word to the left of the cursor
  3144.  
  3145. delete-window         ^X-0    Remove the current window from the screen
  3146.  
  3147. describe-bindings    (none)    Make a list of all legal commands
  3148.  
  3149. describe-key         ^X-?    Describe what command is bound to a
  3150.                 keystroke sequence
  3151.  
  3152. detab-line         ^X-^D    Change all tabs in a line to the
  3153.                 equivalent spaces
  3154.  
  3155. end-macro         ^X-)    stop recording a keyboard macro
  3156.  
  3157. end-of-file         M->    Move cursor to the end of the current buffer
  3158.  
  3159. end-of-line         ^E    Move to the end of the current line
  3160.  
  3161.  
  3162.                                       47
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169. A                         MicroEMACS Reference Manual
  3170.  
  3171.  
  3172. entab-line         ^X-^E    Change multiple spaces to tabs where
  3173.                 possible
  3174.  
  3175. exchange-point-and-mark  ^X-^X    Move cursor to the last marked spot,
  3176.                 make the original position be marked
  3177.  
  3178. execute-buffer        (none)    Execute a buffer as a macro
  3179.  
  3180. execute-command-line    (none)    Execute a line typed on the command
  3181.                 line as a macro command
  3182.  
  3183. execute-file         FNB    Execute a file as a macro
  3184.  
  3185. execute-macro         ^X-E    Execute the keyboard macro (play back
  3186.                 the recorded keystrokes)
  3187. execute-macro-<n>    (none)    Execute numbered macro <N> where <N> is
  3188.                 an integer from 1 to 40
  3189.  
  3190. execute-named-command     M-X    Execute a command by name
  3191.  
  3192. execute-procedure     M-^E    Execute a procedure by name
  3193.  
  3194. exit-emacs         ^X-^C    Exit EMACS. If there are unwritten,
  3195.                 changed buffers EMACS will ask to confirm
  3196.  
  3197. fill-paragraph         M-Q    Fill the current paragraph
  3198.  
  3199. filter-buffer         ^X-#    Filter the current buffer through an
  3200.                 external filter
  3201.  
  3202. find-file         ^X-^F    Find a file to edit in the current window
  3203.  
  3204. forward-character     ^F    Move cursor one character to the right
  3205.  
  3206. goto-line         M-G    Goto a numbered line
  3207.  
  3208. goto-matching-fence     M-^F    Goto the matching fence
  3209.  
  3210. grow-window         ^X-^    Make the current window larger
  3211.  
  3212. handle-tab         ^I    Insert a tab or set tab stops
  3213.  
  3214. hunt-forward         FN=    Hunt for the next match of the last
  3215.                 search string
  3216.  
  3217. hunt-backward         FN>    Hunt for the last match of the last
  3218.                 search string
  3219.  
  3220. help             M-?    Read EMACS.HLP into a buffer and display it
  3221.  
  3222. i-shell                  ^X-C    Shell up to a new command processor
  3223.  
  3224. incremental-search     ^X-S    Search for a string, incrementally
  3225.  
  3226.  
  3227.  
  3228. 48
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235. MicroEMACS Reference Manual                           A
  3236.  
  3237.  
  3238. insert-file         ^X-^I    insert a file at the cursor in the
  3239.                 current file
  3240.  
  3241. insert-space         ^C    Insert a space to the right of the cursor
  3242.  
  3243. insert-string        (none)    Insert a string at the cursor
  3244.  
  3245. kill-paragraph         M-^W    Delete the current paragraph
  3246.  
  3247. kill-region         ^W    Delete the current marked region, moving
  3248.                 it to the kill buffer
  3249.  
  3250. kill-to-end-of-line     ^K    Delete the rest of the current line
  3251.  
  3252. list-buffers         ^X-^B    List all existing buffers
  3253.  
  3254. meta-prefix         <ESC>    Key used to precede all META commands
  3255.  
  3256. move-window-down     ^X-^N    Move all the lines in the current window down
  3257.  
  3258. move-window-up         ^X-^P    Move all the lines in the current window up
  3259.  
  3260. name-buffer         M-^N    Change the name of the current buffer
  3261.  
  3262. newline                  ^M    Insert a <NL> at the cursor
  3263.  
  3264. newline-and-indent     ^J    Insert a <NL> at the cursor and indent
  3265.                 the new line the same as the preceding line
  3266.  
  3267. next-buffer         ^X-X    Bring the next buffer in the list into
  3268.                 the current window
  3269.  
  3270. next-line         ^N    Move the cursor down one line
  3271.  
  3272. next-page         ^V    Move the cursor down one page
  3273.  
  3274. next-paragraph         M-N    Move cursor to the next paragraph
  3275.  
  3276. next-window         ^X-O    Move cursor to the next window
  3277.  
  3278. next-word         M-F    Move cursor to the beginning of the
  3279.                 next word
  3280.  
  3281. open-line         ^O    Open a line at the cursor
  3282.  
  3283. pipe-command         ^X-@    Execute an external command and place
  3284.                 its output in a buffer
  3285.  
  3286. previous-line         ^P    Move cursor up one line
  3287.  
  3288. previous-page         ^Z    Move cursor up one page
  3289.  
  3290. previous-paragraph     M-P    Move back one paragraph
  3291.  
  3292.  
  3293.  
  3294.                                       49
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301. A                         MicroEMACS Reference Manual
  3302.  
  3303.  
  3304. previous-window          ^X-P    Move the cursor to the last window
  3305.  
  3306. previous-word         M-B    Move the cursor to the beginning of the
  3307.                 word to the left of the cursor
  3308.  
  3309. query-replace-string     M-^R    Replace all of one string with another
  3310.                 string, interactively querying the user
  3311.  
  3312. quick-exit         M-Z    Exit EMACS, writing out all changed buffers
  3313.  
  3314. quote-character          ^Q    Insert the next character literally
  3315.  
  3316. read-file         ^X-^R    Read a file into the current buffer
  3317.  
  3318. redraw-display         M-^L    Redraw the display, centering the
  3319.                 current line
  3320.  
  3321. resize-window         ^X-W    Change the number of lines in the
  3322.                 current window
  3323.  
  3324. restore-window        (none)    Move cursor to the last saved window
  3325.  
  3326. replace-string         M-R    Replace all occurrences of one string
  3327.                 with another string from the cursor
  3328.                 to the end of the buffer
  3329.  
  3330. reverse-incremental-search^X-R    Search backwards, incrementally
  3331.  
  3332. run             M-^E    Execute a named procedure
  3333.  
  3334. save-file         ^X-^S    Save the current buffer if it is changed
  3335.  
  3336. save-window        (none)    Remember current window (to restore later)
  3337.  
  3338. scroll-next-up         M-^Z    Scroll the next window up
  3339.  
  3340. scroll-next-down     M-^V    Scroll the next window down
  3341.  
  3342. search-forward         ^S    Search for a string
  3343.  
  3344. search-reverse         ^R    Search backwards for a string
  3345.  
  3346. select-buffer         ^X-B    Select a buffer to display in the
  3347.                 current window
  3348.  
  3349. set             ^X-A    Set a variable to a value
  3350.  
  3351. set-encryption-key     M-E    Set the encryption key of the current buffer
  3352.  
  3353. set-fill-column          ^X-F    Set the current fill column
  3354.  
  3355. set-mark            Set the mark
  3356.  
  3357. shell-command         ^X-!    Execute an external command
  3358.  
  3359.  
  3360. 50
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367. MicroEMACS Reference Manual                           A
  3368.  
  3369.  
  3370. shrink-window         ^X-^Z    Make the current window smaller
  3371.  
  3372. split-current-window     ^X-2    Split the current window in two
  3373.  
  3374. store-macro        (none)    Store the following macro lines to a
  3375.                 numbered macro
  3376.  
  3377. store-procedure         (none)    Store the following macro lines to a
  3378.                 named procedure
  3379.  
  3380. transpose-characters     ^T    Transpose the character at the cursor
  3381.                 with the character to the left
  3382.  
  3383. trim-line         ^X-^T    Trim any trailing whitespace from line
  3384.  
  3385. unbind-key         M-^K    Unbind a key from a function
  3386.  
  3387. universal-argument     ^U    Execute the following command 4 times
  3388.  
  3389. unmark-buffer         M-~    Unmark the current buffer (so it is
  3390.                 no longer changed)
  3391.  
  3392. update-screen        (none)    Force a screen update during macro execution
  3393.  
  3394. view-file         ^X-^V    Find a file,and put it in view mode
  3395.  
  3396. wrap-word         M-FNW    Wrap the current word, this is an
  3397.                 internal function
  3398.  
  3399. write-file         ^X-^W    Write the current buffer under a new
  3400.                 file name
  3401.  
  3402. write-message        (none)    Display a string on the command line
  3403.  
  3404. yank             ^Y    yank the kill buffer into the current
  3405.                 buffer at the cursor
  3406.  
  3407.  
  3408.  
  3409.  
  3410.  
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.                                       51
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433. B                         MicroEMACS Reference Manual
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.  
  3441.  
  3442.                    Appendix B
  3443.  
  3444.               MicroEMACS Bindings
  3445.  
  3446.  
  3447.     Below is a complete list of the key bindings used in MicroEMACS.
  3448. This can be used as a wall chart reference for MicroEMACS commands.
  3449.  
  3450.              Default Key Bindings for MicroEmacs 3.8i
  3451.  
  3452.  ^A   Move to start of line          ESC A   Apropos (list some commands)
  3453.  ^B   Move backward by characters     ESC B   Backup by words
  3454.  ^C   Insert space              ESC C   Initial capitalize word
  3455.  ^D   Forward delete              ESC D   Delete forward word
  3456.  ^E   Goto end of line              ESC E   Reset Encryption Key
  3457.  ^F   Move forward by characters      ESC F   Advance by words
  3458.  ^G   Abort out of things          ESC G   Go to a line
  3459.  ^H   Backward delete
  3460.  ^I   Insert tab/Set tab stops
  3461.  ^J   Insert CR-LF, then indent
  3462.  ^K   Kill forward              ESC K   Bind Key to function
  3463.  ^L   Refresh the screen          ESC L   Lower case word
  3464.  ^M   Insert CR-LF              ESC M   Add global mode
  3465.  ^N   Move forward by lines          ESC N   Goto End paragraph
  3466.  ^O   Open up a blank line
  3467.  ^P   Move backward by lines          ESC P   Goto Beginning of paragraph
  3468.  ^Q   Insert literal              ESC Q   Fill current paragraph
  3469.  ^R   Search backwards              ESC R   Search and replace
  3470.  ^S   Search forward
  3471.  ^T   Transpose characters
  3472.  ^U   Repeat command four times       ESC U   Upper case word
  3473.  ^V   Move forward by pages          ESC V   Move backward by pages
  3474.  ^W   Kill region              ESC W   Copy region to kill buffer
  3475.  ^Y   Yank back from killbuffer       ESC X   Execute named command
  3476.  ^Z   Move backward by pages          ESC Z   Save all buffers and exit
  3477.  
  3478.  ESC ^C   Count words in region       ESC ~   Unmark current buffer
  3479.  ESC ^F   Goto matching fence          ESC !   Reposition window
  3480.  ESC ^H   Delete backward word          ESC <   Move to start of buffer
  3481.  ESC ^K   Unbind Key from function    ESC >   Move to end of buffer
  3482.  ESC ^L   Reposition window          ESC .   Set mark
  3483.  ESC ^M   Delete global mode          ESC space    Set mark
  3484.  ESC ^N   Rename current buffer       ESC rubout   Delete backward word
  3485.  ESC ^R   Search & replace w/query      rubout   Backward delete
  3486.  ESC ^S   Change screen rows
  3487.  ESC ^T   Change screen columns
  3488.  ESC ^V   Scroll next window down
  3489.  ESC ^W   Delete Paragraph
  3490.  
  3491.  
  3492. 52
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499. MicroEMACS Reference Manual                           B
  3500.  
  3501.  
  3502.  ESC ^Z   Scroll next window up
  3503.  
  3504.  ^X ?    Describe a key           ^X !   Run 1 command in a subjob
  3505.  ^X =    Show the cursor position   ^X @    Pipe DOS command to buffer
  3506.  ^X ^    Enlarge display window       ^X #   Filter buffer thru DOS filter
  3507.  ^X 0    Delete current window       ^X (   Begin macro
  3508.  ^X 1    Delete other windows       ^X )   End macro
  3509.  ^X 2    Split current window
  3510.                    ^X A   Set variable value
  3511.  ^X ^B     Display buffer list       ^X B   Switch a window to a buffer
  3512.  ^X ^C     Exit MicroEMACS       ^X C   Start a new command processor
  3513.                    ^X D   Suspend MicroEMACS (BSD4.2 only)
  3514.                    ^X E   Execute macro
  3515.  ^X ^F     Find file           ^X F   Set fill column
  3516.  ^X ^I     Insert file
  3517.                    ^X K   Delete buffer
  3518.  ^X ^L     Lower case region
  3519.  ^X ^M     Delete Mode           ^X M   Add a mode
  3520.  ^X ^N     Move window down       ^X N   Rename current filename
  3521.  ^X ^O     Delete blank lines       ^X O   Move to the next window
  3522.  ^X ^P     Move window up            ^X P   Move to the previous window
  3523.  ^X ^R     Get a file from disk       ^X R   Incremental reverse search
  3524.  ^X ^S     Save current file       ^X S   Incremental forward search
  3525.  ^X ^U     Upper case region
  3526.  ^X ^V     View file
  3527.  ^X ^W     Write a file to disk       ^X W   resize Window
  3528.  ^X ^X     Swap "." and mark       ^X X   Use next buffer
  3529.  ^X ^Z     Shrink window           ^X Z   Enlarge display window
  3530.  
  3531. Only under PCDOS:
  3532.  <ALT>-S Hunt forward         SHIFT <F1> - <F10>
  3533.  <ALT>-R Hunt backward         Execute macros 1 - 10
  3534.  
  3535. Usable Modes
  3536. WRAP     Lines going past right margin "wrap" to a new line
  3537. VIEW     Read-Only mode where no modifications are allowed
  3538. CMODE     Change behavior of some commands to work with C better
  3539. EXACT     Exact case matching on search strings
  3540. OVER     Overwrite typed characters instead of inserting them
  3541. CRYPT     Current buffer will be encrypted on write, decrypted on read
  3542. MAGIC     Use regular expression matching in searches
  3543. ASAVE     Save the file every 256 inserted characters
  3544.  
  3545. WHITE/CYAN/MAGENTA/YELLOW/BLUE/RED/GREEN/BLACK    Sets foreground color
  3546. white/cyan/magenta/yellow/blue/red/green/black    Sets background color
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.                                       53
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565. C                         MicroEMACS Reference Manual
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.  
  3573.  
  3574.                    Appendix C
  3575.  
  3576.                Supported machines
  3577.  
  3578.  
  3579.     The following table lists all the hardware/compilers for which I
  3580. currently support MicroEMACS.    This  is  not  exclusive of all machines
  3581. which MicroEMACS will  run on, but I have either run it myself, or had a
  3582. first hand report of it running.
  3583.  
  3584. Hardware    OS        Compiler    Comments
  3585. VAX 780         UNIX V5         native
  3586.         UNIX V7         native
  3587.         BSD 4.2         native        job control supported
  3588.         *VMS        native        only some terminals supported
  3589.  
  3590. NCR Tower    UNIX V5         native
  3591.  
  3592. Fortune 32:16    UNIX V7         native
  3593.  
  3594. IBM-PC        MSDOS 2/3.2    Lattice 2.15    Large CODE/Large DATA
  3595.                 AZTEC 3.4e    Small CODE/Large DATA
  3596.                 *MSC 4.0
  3597.                 *MWC 86
  3598.  
  3599. HP150        MSDOS        Lattice 2.15    Function key labels
  3600.                         for the touch screen
  3601.  
  3602. HP110        MSDOS        Lattice 2.15
  3603.                 Aztec 3.4e
  3604.  
  3605. *Data General 10
  3606.         MSDOS        Lattice 2.15
  3607.  
  3608. *Texas Instruments Professional
  3609.         MSDOS        Lattice 2.15
  3610.  
  3611. Amiga        Intuition    Lattice 3.03    no mouse or menus yet
  3612.                 *Aztec 3
  3613.  
  3614. ST520        TOS        Lattice 3.10    no menus yet,
  3615.                         no shell commands
  3616.  
  3617. Systems to be supported (i.e some code is already written:)
  3618. Macintosh    Finder 5.0    Aztec
  3619.  
  3620. *means that I do not own or have access to the listed compiler and/or
  3621.  machine and must rely upon others to help support it.
  3622.  
  3623.  
  3624. 54
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631. MicroEMACS Reference Manual                           D
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.  
  3638.  
  3639.  
  3640.                    Appendix D
  3641.  
  3642.             Machine Dependent Notes
  3643.  
  3644.  
  3645.     This   appendix   lists   some     notes    specific  to  individual
  3646. implementations  of MicroEMACS. Every attempt has  been  made  to  allow
  3647. EMACS to be identical on all  machines,  but  we have also tried to take
  3648. advantage of function keys, cursor  keys, mice, and special screen modes
  3649. where possible.
  3650.  
  3651.  
  3652. D.1  IBM-PC/XT/AT and its clones
  3653.  
  3654.  
  3655.     The  IBM-PC  family  of computers is supported with a variety of
  3656. different display adapters.  EMACS will attempt to discover what adapter
  3657. is connected and use the proper driver for it. Below is  a  list  of the
  3658. currently supported video adapters:
  3659.  
  3660. Adapter                         $sres        Original mode used
  3661. Monochrome Graphics Adapter    MONO        MONO
  3662. Color Graphics Adapter        CGA        CGA
  3663. Enhanced graphics Adapter    EGA        CGA
  3664.  
  3665.     EMACS also takes advantage of various function keys and the keys
  3666. on the keypad on an IBM-PC.  The function keys    are  initially not bound
  3667. to any particular functions (except by the emacs.rc  startup  file), but
  3668. the keypad keys do default to the following:
  3669.  
  3670. Keypad key    Function
  3671. Home        beginning-of-file
  3672. CSRS UP         previous-line
  3673. Pg Up        previous-page
  3674. CSRS LEFT    backward-character
  3675. CSRS RIGHT    forward-character
  3676. End        end-of-file
  3677. CSRS DOWN    next-line
  3678. Pg Dn        Next-page
  3679.  
  3680.     All these special keys    are  indicated in EMACS macros by use of
  3681. the FN prefix.    Below is a list of many of the keys and  the  codes used
  3682. to specify them.  Also the codes may be gotten by using the describe-key
  3683. (^X ?) command on the suspect key.
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.                                       55
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697. D                         MicroEMACS Reference Manual
  3698.  
  3699.  
  3700.             IBM PC function keys in MicroEmacs
  3701.  
  3702.     function    Function    ^function    Alt-function
  3703.  f1)      FN;          FNT          FN^          FNh
  3704.  f2)      FN<          FNU          FN_          FNi
  3705.  f3)      FN=          FNV          FN`          FNj
  3706.  f4)      FN>          FNW          FNa          FNk
  3707.  f5)      FN?          FNX          FNb          FNl
  3708.  f6)      FN@          FNY          FNc          FNm
  3709.  f7)      FNA          FNZ          FNd          FNn
  3710.  f8)      FNB          FN[          FNe          FNo
  3711.  f9)      FNC          FN\          FNf          FNp
  3712. f10)      FND          FN]          FNg          FNq
  3713.  
  3714. home)      FNG                  FNw
  3715. CuUp)      FNH
  3716. PgUp)      FNI                  FN {Alt 132}
  3717. CuLf)      FNK                  FNs
  3718.  5  )
  3719. CuRt)      FNM                  FNt
  3720.  End)      FNO                  FNu
  3721. CuDn)      FNP
  3722. PgDn)      FNQ                  FNv
  3723.  Ins)      FNR
  3724.  Del)      FNS
  3725.  
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756. 56
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763. MicroEMACS Reference Manual                           D
  3764.  
  3765.  
  3766.  
  3767.  
  3768. D.2  Atari 520/1040ST
  3769.  
  3770.  
  3771.     The ATARI ST family of computers have a dual personality.   They
  3772. may use either a monochrome or a color screen. EMACS supports two screen
  3773. resolutions on each monitor.
  3774.  
  3775. Monitor $sres size #color $palette format
  3776. Color    LOW    40x25    16    000111222333444555666777
  3777.     MEDIUM    80x25    4    000111222333
  3778. Mono    HIGH    80x25    2    000
  3779.     DENSE    80x40    2    000
  3780.  
  3781.     The $palette environment variable can  be  used  to  change what
  3782. color  is  associated  with each color name.  With a color monitor, each
  3783. group  of three digits indicates an octal  number  specifying  the  RED,
  3784. GREEN  and BLUE levels of that color.  Each color digit can vary from  0
  3785. to  7.      For example, the initial setting of $palette in LOW resolution
  3786. is:
  3787.  
  3788.     000700070770007707077777
  3789.  
  3790.     which broken up is:
  3791.  
  3792.     000 700 070 770 007 707 077 777
  3793.  
  3794.     which means:
  3795.  
  3796.     000    Black
  3797.     700    Red
  3798.     070    Green
  3799.     770    Yellow
  3800.     007    Blue
  3801.     707    Magenta
  3802.     077    Cyan
  3803.     777    White
  3804.  
  3805.      Note: DENSE mode is not yet supported in  3.8i.    It  will be
  3806.      soon
  3807.  
  3808.     Also the mouse generates FN prefix codes when moved, or when one
  3809. of  the  two  buttons is pressed. Initially the movement of the mouse is
  3810. bound to movement of the cursor,  and  the left mouse button generates a
  3811. set-mark (M-space) command.   The  cursor keys and the function keys are
  3812. bound similarly to IBM-PC.
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.                                       57
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829. D                         MicroEMACS Reference Manual
  3830.  
  3831.  
  3832.  
  3833.  
  3834. D.3  Amiga 1000
  3835.  
  3836.  
  3837.     The Commodore AMIGA 1000 version  of  MicroEMACS  does    not have
  3838. extensive support of the mouse or of pull down menus as of yet.  It does
  3839. however come up in a  window, and it is possible to re-size it to run in
  3840. different sized  windows.  The M-^S change-screen-size takes its numeric
  3841. argument as the  new number of lines for EMACS to use.    The M-^T change-
  3842. screen-width  command  allows  you to change the number of columns EMACS
  3843. will  use.  The defaults for these are 23 lines and 77 characters across
  3844. for a full screen window.
  3845.  
  3846.             Note about Compiling MicroEMACS
  3847.  
  3848.          If  you  are  compiling the sources on  the  AMIGA  to
  3849.      produce an executable image, and  you  are  using    the Lattice
  3850.      compiler, be sure to give the CLI command 'STACK 40000' before
  3851.      compiling to make sure the compiler has sufficient stack space
  3852.      to successfully complete compilation.
  3853.  
  3854.  
  3855.  
  3856.  
  3857.  
  3858.  
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.  
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888. 58
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895. MicroEMACS Reference Manual                           D
  3896.  
  3897.  
  3898.  
  3899.  
  3900. D.4  UNIX V5, V7, and BSD4.[23]
  3901.  
  3902.  
  3903.     MicroEMACS under UNIX utilizes the  TERMCAP  library  to provide
  3904. machine  independent  screen  functions.    Make  sure    that termcap  is
  3905. available  and properly set on your account  before  attempting  to  use
  3906. MicroEMACS.
  3907.  
  3908.     Under  systems    which  support job control, you can use the ^X-D
  3909. suspend-emacs command to place EMACS  into the background.  This carries
  3910. a much smaller overhead than bringing up a new shell under EMACS.  EMACS
  3911. will  properly    redraw    the  screen  when  you    bring  it  back  to  the
  3912. foreground.
  3913.  
  3914.     With the addition of some very machine/operating system specific
  3915. code, EMACS can prevent two or more people from modifying the  same file
  3916. at the same  time. The upper level of a set of functions to provide file
  3917. locking  exist    in the source file LOCK.C.    It  requires  two  machine
  3918. specific  functions  written  and  linked  into EMACS for it to  operate
  3919. properly.
  3920.  
  3921.     char *dolock(fname)
  3922.  
  3923.     char *fname;
  3924.  
  3925.     dolock() locks a file, preventing others from modifying it. If
  3926.     it succeeds, it returns NULL, otherwise it returns a pointer to
  3927.     a string in the form "LOCK ERROR: explanation".
  3928.  
  3929.     char *undolock(fname)
  3930.  
  3931.     char *fname;
  3932.  
  3933.     undolock() unlocks a file, allowing others to modifying it. If
  3934.     it succeeds, it returns NULL, otherwise it returns a pointer to
  3935.     a string in the form "LOCK ERROR: explanation".
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.                                       59
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961. Index                         MicroEMACS Reference Manual
  3962.  
  3963.  
  3964.  
  3965.  
  3966.  
  3967.  
  3968.  
  3969.  
  3970.                     Index
  3971.  
  3972.  
  3973.     <NL> 12                         entab-lines 33
  3974.                     execute-buffer 37
  3975.     A                execute-file 37
  3976.     add-global-mode 23        execute-macro 35
  3977.     add-mode 3, 23            execute-macro-<n> 37
  3978.                     exit-emacs 8
  3979.     B
  3980.     backward-character 4        F
  3981.     begin-macro 35            file locking 59
  3982.     beginning-of-file 4, 7        fill-paragraph 7, 31
  3983.     beginning-of-line 4        fill column 26
  3984.     buffer 4, 6            find-file 17, 18, 20
  3985.     buffers 20            forward-character 4
  3986.  
  3987.     C                H
  3988.     case-region-lower 32        handle-tab 33
  3989.     case-word-capitalize 32
  3990.     case-word-lower 32        K
  3991.     case-word-upper 32        kill-region 9
  3992.     change-screen-size 58        kill-to-end-of-line 8
  3993.     change-screen-width 58        kill buffer 10
  3994.     color 23
  3995.     control-x 1            L
  3996.     control key 1            list-buffers 21, 23
  3997.     copy-region 10
  3998.     cursor keys 4            M
  3999.                     mark 9
  4000.     D                meta key 1
  4001.     default string 13        mode line 2, 6
  4002.     delete-blank-lines 8        modes 3, 23
  4003.     delete-buffer 21        move-window-down 18
  4004.     delete-global-mode 23        move-window-up 18
  4005.     delete-mode 23
  4006.     delete-next-character 8         N
  4007.     delete-next-word 8        newline 1
  4008.     delete-previous-        next-buffer 20
  4009.          character 7        next-line 3
  4010.     delete-previous-word 8        next-paragraph 4
  4011.     detab-line 33
  4012.                     O
  4013.     E                open-line 7
  4014.     encryption 24
  4015.     end-macro 35            P
  4016.     end-of-file 4            point 9
  4017.     end-of-line 4            previous-line 3
  4018.  
  4019.  
  4020. 60
  4021.  
  4022.  
  4023.  
  4024.  
  4025.  
  4026.  
  4027. MicroEMACS Reference Manual                       Index
  4028.  
  4029.  
  4030.     previous-paragraph 4        set-fill-column 31
  4031.     previous-window 17        set-mark 9
  4032.     previous-word 3                 special keys 1
  4033.                     split-current-window 17
  4034.     Q                suspend-emacs 59
  4035.     query-replace 14
  4036.     query-replace-string 14         T
  4037.                     tab handling 33
  4038.     R                termcap 59
  4039.     replace-string 13        text window 2
  4040.  
  4041.     S                W
  4042.     save-file 4            window 6
  4043.     screen 6            windows 2, 17
  4044.     scroll-next-down 18        wrap-word 26
  4045.     scroll-next-up 18        wrapping text 31
  4046.     search-forward 12        write-file 4
  4047.     search-reverse 13
  4048.     select-buffer 20        Y
  4049.     set-encryption-key 24        yank 10
  4050.  
  4051.  
  4052.  
  4053.  
  4054.  
  4055.  
  4056.  
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075.  
  4076.  
  4077.  
  4078.  
  4079.  
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085.  
  4086.                                       61
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.                  Table of Contents
  4100.  
  4101.  
  4102.  
  4103.  
  4104.  
  4105.      Chapter 1    Basic Concepts                                    1
  4106.     1.1  Keys and the Keyboard . . . . . . . . . . . . . . .  1
  4107.     1.2  Getting Started . . . . . . . . . . . . . . . . . .  1
  4108.     1.3  Parts and Pieces  . . . . . . . . . . . . . . . . .  2
  4109.     1.4  Entering Text . . . . . . . . . . . . . . . . . . .  2
  4110.     1.5  Basic cursor movement . . . . . . . . . . . . . . .  3
  4111.     1.6  Saving your text  . . . . . . . . . . . . . . . . .  4
  4112.  
  4113.      Chapter 2    Basic Editing--Simple Insertions and Deletions    6
  4114.     2.1  A Word About Windows, Buffers, Screens, and Modes .  6
  4115.     2.2  Insertions  . . . . . . . . . . . . . . . . . . . .  7
  4116.     2.3  Deletions . . . . . . . . . . . . . . . . . . . . .  7
  4117.  
  4118.      Chapter 3    Using Regions                                     9
  4119.     3.1  Defining and Deleting a Region  . . . . . . . . . .  9
  4120.     3.2  Yanking a Region  . . . . . . . . . . . . . . . . . 10
  4121.  
  4122.      Chapter 4    Search and Replace                               12
  4123.     4.1  Forward Search  . . . . . . . . . . . . . . . . . . 12
  4124.     4.2  Exact Searches  . . . . . . . . . . . . . . . . . . 13
  4125.     4.3  Backward Search . . . . . . . . . . . . . . . . . . 13
  4126.     4.4  Searching and Replacing . . . . . . . . . . . . . . 13
  4127.     4.5  Query-Replace . . . . . . . . . . . . . . . . . . . 14
  4128.  
  4129.      Chapter 5    Windows                                          17
  4130.     5.1  Creating Windows  . . . . . . . . . . . . . . . . . 17
  4131.     5.2  Deleting Windows  . . . . . . . . . . . . . . . . . 18
  4132.     5.3  Resizing Windows  . . . . . . . . . . . . . . . . . 18
  4133.     5.4  Other Window commands . . . . . . . . . . . . . . . 18
  4134.  
  4135.      Chapter 6    Buffers                                          20
  4136.  
  4137.      Chapter 7    Modes                                            23
  4138.     7.1  ASAVE mode  . . . . . . . . . . . . . . . . . . . . 23
  4139.     7.2  CMODE mode  . . . . . . . . . . . . . . . . . . . . 24
  4140.     7.3  CRYPT mode  . . . . . . . . . . . . . . . . . . . . 24
  4141.     7.4  EXACT mode  . . . . . . . . . . . . . . . . . . . . 24
  4142.     7.5  MAGIC mode  . . . . . . . . . . . . . . . . . . . . 25
  4143.     7.6  OVER mode . . . . . . . . . . . . . . . . . . . . . 26
  4144.     7.7  WRAP mode . . . . . . . . . . . . . . . . . . . . . 26
  4145.     7.8  VIEW mode . . . . . . . . . . . . . . . . . . . . . 26
  4146.  
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.                     i
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.      Chapter 8    Files                                            28
  4163.  
  4164.      Chapter 9    Screen Formatting                                31
  4165.     9.1  Wrapping Text . . . . . . . . . . . . . . . . . . . 31
  4166.     9.2  Reformatting Paragraphs . . . . . . . . . . . . . . 31
  4167.     9.3  Changing Case . . . . . . . . . . . . . . . . . . . 31
  4168.     9.4  Tabs  . . . . . . . . . . . . . . . . . . . . . . . 32
  4169.  
  4170.      Chapter 10  Keyboard Macros                                 35
  4171.  
  4172.      Chapter 11  MicroEMACS Macros                               37
  4173.     11.1  Variables  . . . . . . . . . . . . . . . . . . . . 37
  4174.        11.1.1  Environmental Variables . . . . . . . . . . . 38
  4175.        11.1.2  User variables  . . . . . . . . . . . . . . . 39
  4176.        11.1.3  Buffer Variables  . . . . . . . . . . . . . . 39
  4177.        11.1.4  Interactive variables . . . . . . . . . . . . 40
  4178.     11.2  Functions  . . . . . . . . . . . . . . . . . . . . 40
  4179.     11.3  Directives . . . . . . . . . . . . . . . . . . . . 42
  4180.        11.3.1  !ENDM Directive . . . . . . . . . . . . . . . 43
  4181.        11.3.2  !FORCE Directive  . . . . . . . . . . . . . . 43
  4182.        11.3.3  !IF, !ELSE, and !ENDIF Directives . . . . . . 43
  4183.        11.3.4  !GOTO Directive . . . . . . . . . . . . . . . 44
  4184.        11.3.5  !RETURN Directive . . . . . . . . . . . . . . 45
  4185.  
  4186.      Appendix A  MicroEMACS commands                 46
  4187.  
  4188.      Appendix B  MicroEMACS Bindings                 52
  4189.  
  4190.      Appendix C  Supported machines                 54
  4191.  
  4192.      Appendix D  Machine Dependent Notes             55
  4193.     D.1  IBM-PC/XT/AT and its clones . . . . . . . . . . . . 55
  4194.     D.2  Atari 520/1040ST  . . . . . . . . . . . . . . . . . 57
  4195.     D.3  Amiga 1000  . . . . . . . . . . . . . . . . . . . . 58
  4196.     D.4  UNIX V5, V7, and BSD4.[23]  . . . . . . . . . . . . 59
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.                    ii
  4219.  
  4220.  
  4221.  
  4222.